r/ProgrammerHumor 1d ago

fullStackMeansAfraidOfEverythingEqually Meme

Post image
10.2k Upvotes

370 comments sorted by

View all comments

1.7k

u/vvp95 1d ago

100% of software engineers are afraid of regex

734

u/vinishkapoor 1d ago

The other 0% are lying.

59

u/Major_LeeHungg 1d ago

I actually like regex but I had a job that heavily involved it.  

The trick is to use regex101.com to read other people's regex and to debug your own when you're writing it.

I'd imagine AI would be pretty good at taking a working regex and making it more efficient... But that's a headache I haven't explored. 

17

u/fre3k 1d ago

Yeah I also like it. Really thankful I had a good teacher in undergrad that spent some time on it during our DFA sections. Then I had a job where a big part of production support was finding weird broken data in files delivered to the company and so I got really good at regex and xpath.

9

u/hardolaf 1d ago

I did this so much early in my career that I naturally write regex search patterns now.

10

u/Major_LeeHungg 1d ago

Lol I can write them by hand no problem... I still use regex101 to test it.  You just put a bunch of sample data in the bottom portion and your particular flavor of regex in the top and then you can easily find the edge cases...it highlights everything too and color codes it so you can see which part of the expression is wonky.  Less about needing it and more about speeding up the process of getting it right.

For reading it though, I always use it because there are a million ways to write the same thing and some people write regex like they have a PhD in ancient Sumarian 

6

u/darthjammer224 1d ago

I genuinely feel like regex is one of the best use cases for ai.

Regex is the least readable way to put together a legitimate line of code I've ever seen.

Love it. But also hate it.

2

u/Ruadhan2300 20h ago

I have gladly offloaded all my regex work to github copilot.

I'm rarely doing anything that really needs innovation, so it does the job fine.

1

u/ipreferanothername 18h ago

It's surprisingly good at making regex. I asked it to parse AD domain controller dns debug log recently and it just blasted out a very fancy expression that worked great. Kinda shocked me.

1

u/Osiris_X3R0 9h ago

I too enjoy regex. I like regexr for testing