gram on Nostr: npub1e7vnd…5flg9 My code-golf-ready solution: repl = lambda m: f'{len(m.group(1))}' ...
npub1e7vndtpf0s9pcg6yxkmvwvfq2g56rg5694nlgthwg7j2hkjgeuwq65flg9 (npub1e7v…flg9)My code-golf-ready solution:
repl = lambda m: f'{len(m.group(1))}'
re.sub('\w(\w{3,})\w', repl, text)
Or something like this, I can't check it from phone. I think it might eat away the first and last letter but it should be easy to make repl a normal function that includes them.
I wonder if I can make it more cursed. Go full regex, perhaps? 🤔
Published at
2023-08-21 18:24:53Event JSON
{
"id": "a46e64c87f82b41a6a030fb6d4809772547d401bbb608a86af5fc620349e041c",
"pubkey": "bea83a9da72be14df35d74e1f5797c64e53e090ef24eebef3483311b2240130d",
"created_at": 1692642293,
"kind": 1,
"tags": [
[
"p",
"cf9936ac297c0a1c234435b6c731205229a1a29a2d67f42eee47a4abda48cf1c",
"wss://relay.mostr.pub"
],
[
"p",
"ece51acfc6c84a5f625a755bed921f6eac6a9daa6f90817047901dbe0231522f",
"wss://relay.mostr.pub"
],
[
"e",
"9397b59492d5b2b08e93d9e3c129e971fada4e93d538177d9dadfaf2fe12887f",
"wss://relay.mostr.pub",
"reply"
],
[
"proxy",
"https://fosstodon.org/users/orsinium/statuses/110929005364956694",
"activitypub"
]
],
"content": "nostr:npub1e7vndtpf0s9pcg6yxkmvwvfq2g56rg5694nlgthwg7j2hkjgeuwq65flg9\n\nMy code-golf-ready solution:\n\nrepl = lambda m: f'{len(m.group(1))}'\nre.sub('\\w(\\w{3,})\\w', repl, text)\n\nOr something like this, I can't check it from phone. I think it might eat away the first and last letter but it should be easy to make repl a normal function that includes them.\n\nI wonder if I can make it more cursed. Go full regex, perhaps? 🤔",
"sig": "ea49d97f45bf02a39b37a1586b6cac1b07b5da401ede988701cdbb752905b2f03fbee3f3f675649ce3c96df5cefb89c6658541d1863740c0aa5acadf86778b7d"
}