this post was submitted on 05 Mar 2025
1578 points (99.0% liked)

Programmer Humor

21027 readers
854 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

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] conditional_soup@lemm.ee 105 points 2 days ago* (last edited 1 day ago) (22 children)

Regex

Edit: to everyone who responded, I use regex infrequently enough that the knowledge never really crystalizes. By the time I need it for this one thing again, I haven't touched it in like a year.

[–] Kissaki@programming.dev 12 points 1 day ago (7 children)

You always forget regex syntax?

I've always found it simple to understand and remember. Even over many years and decades, I've never had issues reading or writing simple regex syntax (excluding the flags and shorthands) even after long regex breaks.

[–] Akito@lemmy.zip 14 points 1 day ago (6 children)

It's not about the syntax itself, it's about which syntax to use. There are different ones and remembering which one is for which language is tough.

[–] Lehmanator@programming.dev 2 points 14 hours ago

This is exactly it. Regex is super simple. The difficulty is maintaining a mental mapping between language/util <-> regex engine <-> engine syntax & character class names. It gets worse when utils also conditionally enable extended syntaxes with flags or options.

The hardest part is remembering whether you need to use \w or [:alnum:].

Way too few utils actually mention which syntax they use too. Most just say something accepts a "regular expression", which is totally ambiguous.

load more comments (5 replies)
load more comments (5 replies)
load more comments (19 replies)