this post was submitted on 23 Jul 2025
253 points (100.0% liked)
Programmer Humor
28424 readers
1306 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
How so? I have been getting much more comfortable with it lately, but I am curious what downsides there are
The downsides are having to relearn it every time you need to understand it.
Just use something like https://regex101.com/
not really i just meant they suck to remember how to write without looking up :)
Here is my cheatsheet that has been very helpful. Obviously, this will not teach you how RegEx works, but is a good quick reference when I forget the exact syntax for something.
RegExp
Character classes
.\w\d\s\W\D\S[abc][a-e]aande[1-9]1and9[[:print:]][^abc]a,borcAnchors
\G^$\A\Z\z\b\B^abcabcabc$abcFor multiline patterns (
mflag),^and$will act as start and end of line.Escaped characters
\. \* \\\t\n\rGroups
(abc)(a|b)aorb(?:abc)abc, but don't capture\1Quantifiers
a*a+a?a{5}a{,3}a{3,}a{1,3}Lookahead & Lookbehind
| Pattern | Description | |
|
a(?=b)| Matchainbabybut not inbay| |a(?!b)| MatchainStanbut not inStab| |(?<=a)b| Matchbincrabsbut not incribs| |(?<!a)b| Matchbinfibbut not infab| |(?<![a-z])abc(?![a-z])| Matchabcwithout any letters before/after |Raw Markdown