blog.ratterobert.com

prologic (twtxt.net)

Problems are Solved by Method\" πŸ‡¦πŸ‡ΊπŸ‘¨β€πŸ’»πŸ‘¨β€πŸ¦―πŸΉβ™” πŸ“βš― πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘§πŸ›₯ -- James Mills (operator of twtxt.net / creator of Yarn.social 🧢)

prologic (twtxt.net)

Regex Isn't Hard - Tim Kellogg πŸ‘ˆ this is a pretty good conscience article on regexes, and I agree, regex isn't that hardβ„’ -- However I think I can make the TL;DR even shorter πŸ˜…


Regex core subset (portable across languages):

Character sets β€’ a matches β€œa” β€’ [a-z] any lowercase β€’ [a-zA-Z0-9] alphanumeric β€’ [^ab] any char but a or b

Repetition (applies to the preceding atom) β€’ ? zero or one β€’ * zero or more β€’ + one or more

Groups β€’ (ab)+ matches β€œab”, β€œabab”, … β€’ Capture for extract/substitute via $1 or \1

Operators β€’ foo|bar = foo or bar β€’ ^ start anchor β€’ $ end anchor

Ignore non‑portable shortcuts: \w, ., {n}, *?, lookarounds.

#regex101

Read replies 3 weeks ago
Reply via email