1673
you are viewing a single comment's thread
view the rest of the comments
[-] Akito@lemmy.zip 16 points 1 year ago

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 3 points 1 year 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.

[-] PlexSheep@infosec.pub 2 points 1 year ago* (last edited 1 year ago)

I give you that, true. I wish vim had PCRE

[-] ewenak@jlai.lu 0 points 1 year ago

There is the "very magic" mode for vim regexes. It's not the exact PCRE syntax, but it's pretty close. You only need to add \v before the expression to use it. There is no permanent mode / option though. (I think you can remap the commands, like / to /\v)

[-] Lehmanator@programming.dev 1 points 1 year 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.

[-] Lehmanator@programming.dev 1 points 1 year 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.

[-] Lehmanator@programming.dev 1 points 1 year 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.

this post was submitted on 05 Mar 2025
1673 points (98.9% liked)

Programmer Humor

30344 readers
2276 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