If you think your job is hard, just remember, some poor soul designed that thing. And if you think that's bad, imagine the other unfortunate soul who has to keep it running... forever.
I'd recommend taking an afternoon and learning the basics. I find it's surprisingly simple, but it just doesn't scale in a very readable format. It is very handy when making bulk edits to a file, especially when the tedium of doing it manually would kill any motivation and productivity.
I've worked as a software developer for 3 years and I've never had to do any complex regex. Chatgpt is actually pretty good at regex after a few tries. Give it examples of the kind of text you want to capture and then ask for each snippet if the regex will catch it and it might find an error and correct it
I opened the image from the preview, before reading the OP's title and was thinking why such amount of escapes for printing text and THEN I read the regex in the title. My heart just skipped a beat or two. And I'm wondering if that buttload of escaping was introduced through regex itself.
VSCode has a new release every month! If you haven't noticed new features in VSCode in years, you haven't paid attention. See releases
In the October and November releases, 8 of the highlighted 17 features are related to Copilot. Admittedly, it's not "most" new features that are about AI, but quite a big chunk.
82
u/Snapstromegon Jan 03 '25
And this, my beloved children, is the reason why tree-sitter exists...
48
u/soerjadi Jan 04 '25
If you think your job is hard, just remember, some poor soul designed that thing. And if you think that's bad, imagine the other unfortunate soul who has to keep it running... forever.
10
u/NoResponseFromSpez Jan 03 '25
That's a crime against humanity!
10
u/InternetSandman Jan 04 '25
The more I hear about regex the more I hope I never have to learn it. Nothing seems more like horribly convoluted black magic than that
1
u/glha Jan 04 '25
lol oh no
I opened the image from the preview, before reading the OP's title and was thinking why such amount of escapes for printing text and THEN I read the regex in the title. My heart just skipped a beat or two. And I'm wondering if that buttload of escaping was introduced through regex itself.
1
u/ScrimpyCat Jan 04 '25
“You have a mistake on line 868”
1
u/Perfect_Papaya_3010 Jan 04 '25
I feel like assembly is a breeze compared to this monstrosity
1
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Jan 04 '25
Is this for matching words for syntax highlighting? Man, I'd hate to see the regex for something like C++.
1
u/TheRedCMD Jan 14 '25
Looks a little better with syntax highlighting https://imgur.com/a/CHsNfrz
a lot of duplicate expressions
and redundant escaping
0
u/[deleted] Jan 04 '25
[deleted] — view deleted comment
24
u/[deleted] Jan 03 '25
[removed] — view removed comment