blog.ratterobert.com

Conversation

Recent posts in reply to #r2hdu6q

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 2 weeks ago
bender (twtxt.net)

@prologic was this a copy and paste? I am betting $100 it was. DM me for more information. 😅

In reply to: #r2hdu6q 2 weeks ago
prologic (twtxt.net)

@bender Not copy/paste 🤣 Hand on heart! ❤️ However it was a pretty nice article 😅

In reply to: #r2hdu6q 2 weeks ago
Reply via email