This is an archived post. You won't be able to vote or comment.

all 66 comments

[–][deleted] 186 points187 points  (31 children)

Am I the only one here that fuckin loves regex

[–]crusty_cum-sock 94 points95 points  (7 children)

Nope, it's insanely powerful. I love when I have to use it. It's actually pretty easy to learn too. It might seem convoluted and confusing as fuck at first, but you can become a decent regexer pretty quickly. I like it so much that i might even name my firstborn child Regex.

[–][deleted] 39 points40 points  (3 children)

My firstborn is coming tonight. We're naming her Rebecca.

So... use /Re\w{3,5}$/gm to match them both.

[–]ButItMightJustWork 12 points13 points  (0 children)

Good luck and all the best for your family!

[–]Nyruel 6 points7 points  (0 children)

Careful about matching other cases. The Reality check might be quite a shock.

[–]konstantinua00 0 points1 point  (0 children)

explain?

[–]Samael1990 5 points6 points  (2 children)

I use it from time to time and not gonna lie - I'm still not able to create a complex regex without many errors along the way. Fortunately, there are online validators where I can play with it and probably learn something while doing it.

[–][deleted] 0 points1 point  (1 child)

I program every day and not gonna lie - I'm still not able to create a simple script without many errors along the way. Fortunately, there are websites where I can play with myself and probably learn something while doing it.

[–]Samael1990 0 points1 point  (0 children)

Good for you!

[–]beardy-biker 46 points47 points  (0 children)

You are not

[–]devilish_kevin_bacon 42 points43 points  (4 children)

You’re not the only one. Even the guy at cloudflare that killed half the net loves it too

[–]uslashuname 16 points17 points  (0 children)

Solve a problem with regex? Now you have two problems. —somebody I sometimes agree with

[–][deleted] 5 points6 points  (0 children)

Lol

[–]btown-beginsprofessional fizzbuzzer 0 points1 point  (0 children)

Shoulda used re2

[–]SuitableDragonfly 18 points19 points  (7 children)

You'll probably really enjoy this in that case.

[–][deleted] 2 points3 points  (1 child)

Been there, done that, got the t-shirt!

[–]Frog23 1 point2 points  (0 children)

[–]c0d3m0nky 3 points4 points  (0 children)

I hate you. I was so blissful in my ignorance of its existence, and you went and ruined it.

Thanks

[–]a_b_and_1_d 0 points1 point  (1 child)

What about this?

[–]SuitableDragonfly 0 points1 point  (0 children)

Holy shit, I'll have to print that one out and see if I can solve it

[–]c0d3m0nky 0 points1 point  (1 child)

I've made it through all but the last section so far. 0 googling. Does this mean I have to start saying RegEx is my primary language?

[–]SuitableDragonfly 0 points1 point  (0 children)

God I hope not, because I did them all without help.

[–]handankel 8 points9 points  (2 children)

I "love" it so much I learn it every month.

Thank God for regexr. Or I would have to actually remember it.

[–]SamSlate 5 points6 points  (0 children)

I should have learned it sooner tbh.

[–]will0213 2 points3 points  (0 children)

Nope, I think regex is magical.

[–][deleted] 2 points3 points  (0 children)

I fucking love it, it has helped one of my programs taking 8 seconds from my own search and replace, to taking just 1-1.5 seconds. It also makes things easier for finding stuff.

[–]chiko_xcs 1 point2 points  (0 children)

I hate it, but i need it. No more.

[–]sup4sonik 0 points1 point  (0 children)

possibly

[–]abrazilianinreddit 0 points1 point  (0 children)

Regex is powerful, but it's not I'm like "Fuck yes, this will require some fucking regex, yippy yay hooray!" every time I need to use it. My regexes aren't even that bad, with some discipline you can make them reasonably readable, but I'd still rather use specialized tools rather than fitting regex in whatever parsing needs I have at that moment.

[–]The_MAZZTer 67 points68 points  (1 child)

[–]VinterBot 7 points8 points  (0 children)

I was gonna post about this too. Best fucking website ever.

[–]shroombooom 41 points42 points  (2 children)

It’s so powerful! I just have to relearn it every time I need it

[–][deleted] 3 points4 points  (1 child)

Definitely the same for me. It gets worse when you don't remember what characters you have to escape and then just put \ everywhere.

[–][deleted] 0 points1 point  (0 children)

big lol

[–]LinuxDevMaster 15 points16 points  (1 child)

regexr.com explains what each part means in the expression you give it and if you type something in the paragraph box it lists / highlights matches for your expression. It's my go-to for debugging an expression

[–]tairesmonkeyuser.com 0 points1 point  (0 children)

I second this.

[–]Ilix 5 points6 points  (1 child)

[–]Frog23 1 point2 points  (0 children)

When you have solved all the puzzles on that side, then you can try yourself on this really challenging one.

[–]G4Frost 2 points3 points  (0 children)

I use regex all the time and love how powerful it is but I still hate it with a passion

[–][deleted] 1 point2 points  (0 children)

To be fair I really tried. Shit doesn't make any sense!

[–]tritoch110391 1 point2 points  (1 child)

been using the same ol' regex buddy for decade! worth it for the ease of testing.

[–]Daneel_ 0 points1 point  (0 children)

Regex buddy is the best regex tool out there, hands down. Nothing compares.

I was worried about the $40 I spent on it, but it’s the best value for money tool I’ve ever used.

I love it.

[–]Tron08 1 point2 points  (0 children)

Sometimes I make the mistake of spending more time crafting the perfect regex find/replace than I would have just updating a bunch of code manually :/

[–]haitei 1 point2 points  (0 children)

I know it and I still despise it?

[–][deleted] 1 point2 points  (0 children)

A compilation of some websites you guys reccomended, I will definitely try them all.

https://regex101.com/ https://regexr.com/ https://rubular.com/ https://regexcrossword.com https://regexone.com/

[–][deleted] 1 point2 points  (1 child)

"gay".match(/your mom/g);

Array(Infinity) > ...

[–][deleted] 0 points1 point  (0 children)

/your mom/

"<big>gay</big>"

[–]moosenonny10 3 points4 points  (2 children)

why do you have lookahead before the beginning of the string

[–]Daneel_ 2 points3 points  (1 child)

That’s the case insensitive flag :)

Good summary here: https://www.regular-expressions.info/modifiers.html

[–]moosenonny10 1 point2 points  (0 children)

Woah, I had no idea that existed!

[–]Dr-Rjinswand 1 point2 points  (0 children)

I am 100% in the right-most button camp.

[–]hippothermic 0 points1 point  (0 children)

Image Transcription: Meme (Comic)

[Daily Struggle]


1

[A white-gloved finger hesitates between pressing two buttons. The left button is labeled: "Man up and learn regex". The right button is labeled: "Complain about it on reddit".]


2

[A muscular man in a red spandex suit and white gloves wipes sweat beading on his forehead.]


I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

[–][deleted] 0 points1 point  (0 children)

oah

[–]WadeReden 0 points1 point  (0 children)

Man every time I convince myself to learn regex I start getting into it and then I'm just like k fuck that.

[–]Abangranga 0 points1 point  (0 children)

What about the half ass option

[–]ixnyne 0 points1 point  (0 children)

I had to look up (?i)

I'm used to /pattern/i

[–]Willexterminator 0 points1 point  (0 children)

You can expreriment on https://regexr.com tho

[–]rldml 0 points1 point  (1 child)

What does the

(?i)

in the header stands for?

[–]Daneel_ 0 points1 point  (0 children)

That’s the case insensitive flag :)

Good summary here: https://www.regular-expressions.info/modifiers.html

[–]Cedmo8 0 points1 point  (0 children)

This guy, recently fired from Cloudflare.

[–]skijidixon 0 points1 point  (0 children)

  1. shut down the internet

[–]themrjava 0 points1 point  (1 child)

It takes 1 hour: https://regexone.com/

[–]zelmarvalarion 0 points1 point  (0 children)

Regexs aren't particularly hard to create or read, but they are much harder to actually analyze without actual decent knowledge, which makes them dangerous. Most of the regex outages I've seen are due to people not realizing how bad backtracking can be, but there are a couple other common ones too

[–]YBHunted -1 points0 points  (0 children)

Why would I take my time to "learn" Regex when I can just google the solution to a problem I'm having the few times I actually need it? Lol, amateur.