Kalamata Hari on Nostr: A regex always finds the leftmost match. Your first regex, [0-9]*, can match at ...
A regex always finds the leftmost match. Your first regex, [0-9]*, can match at offset 0 in >335 because * means "0 or more of the preceding thing", so it can match all 0 digits before >. On the other hand, [0-9]{1,3} requires at least one digit to match, so the first location where it can succeed is at offset 1, matching all three available digits.
Published at
2025-01-14 20:15:38Event JSON
{
"id": "d4f36d2fd9f958e887f1da266c04dcacec948f3db551d4c90ccc599991edc4a1",
"pubkey": "6d0f857a590ed3d99385c319245dcae71fde494649d11ff430726857dd1501c3",
"created_at": 1736885738,
"kind": 1,
"tags": [
[
"e",
"53f4842f1d21cf6853f6a0310ae508bbb7ad0b36189a9b68250b476ad6945c50",
"",
"root",
"14965443867d679e8aefaf4b76d6af788bf00e8b2dcff9cbe51a110f2ba4c6e7"
],
[
"p",
"14965443867d679e8aefaf4b76d6af788bf00e8b2dcff9cbe51a110f2ba4c6e7"
],
[
"proxy",
"https://infosec.exchange/@barubary/113828543747154378",
"web"
],
[
"proxy",
"https://infosec.exchange/users/barubary/statuses/113828543747154378",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://infosec.exchange/users/barubary/statuses/113828543747154378",
"pink.momostr"
],
[
"-"
]
],
"content": "A regex always finds the leftmost match. Your first regex, [0-9]*, can match at offset 0 in \u0026gt;335 because * means \"0 or more of the preceding thing\", so it can match all 0 digits before \u0026gt;. On the other hand, [0-9]{1,3} requires at least one digit to match, so the first location where it can succeed is at offset 1, matching all three available digits.",
"sig": "71978502f43dd8606d31f3ae818d60efb834575dc8551d3529217c1aede3170f7ea165c6ed06ff44a74a3c18e6b94ae899596a06436060b2f5f008f0aa985fb0"
}