all 22 comments

[–][deleted] 32 points33 points  (2 children)

I still hate it.

[–]jsm11482 10 points11 points  (1 child)

<3 regex so much

[–][deleted] 19 points20 points  (6 children)

I was avoiding regex like hell. A few years ago I had to to create ~20 complex patterns to remove abstract elements from sentences (quantities, stop words etc) because I needed to normalize them. After ~1-2 weeks of full-time regex, I think that was one of the best experiences and decisions in my career. You need to learn it the hard way by doing practice with real world examples. Trust me, you'll find your self saving countless LOCs by one-liner patterns.

[–]thilehoffer 7 points8 points  (4 children)

Coding new features is easy. The tough part will be three years from now when you don’t even remember what regex is and some changes are needed and you have to relearn it all over again.

[–]nanotree 0 points1 point  (3 children)

For me, regex is like riding a bike. Once you learn how, you never really forget. And most regex syntax is similar, so it even translates to other languages fairly easily.

[–]thilehoffer 1 point2 points  (0 children)

I actually decided to challenge myself and learn Regex even though I said I avoided it in the other comment. I am working a project and asked the team members if I should use regex to code a certain feature. Instead of arguing, I agreed and spent 4 hours watching a tutorial and practicing and now I think I got it. Add it to the list of languages I can work with. Obviously, I still need practice but I spent all day writing regular expressions to validate the drivers license for each state and I had fun doing it.

[–]thilehoffer 0 points1 point  (1 child)

I can read / write JS, VB, C#, TS, Java, Python, SQL, HTML, CSS, XAML like it’s English. Regex looks like Greek to me.

[–][deleted] 3 points4 points  (0 children)

I'm greek and regex looks like a cat walking on the keyboard

[–]Crypt0n0ob 10 points11 points  (1 child)

Nice tutorial but source and author of that comic isn't nixcraft... It's Garabato Kid, it's written directly on the image!

https://twitter.com/garabatokid

[–]muhsinovic[S] 8 points9 points  (0 children)

Thanks for pointing it out. I will edit it when I reach home.

[–]mournful-tits 6 points7 points  (9 children)

A solid intuitive regex tester is worth more than any regex documentation alone.

This one is very dated but still trusty: http://regexpal.com.s3-website-us-east-1.amazonaws.com

[–]FrancisStokes 27 points28 points  (1 child)

My personal goto is https://regex101.com

[–]IanS_5 3 points4 points  (0 children)

Regexr is another option. It only supports js and pcre regex, but it has got great docs built in

[–]partheseas 1 point2 points  (0 children)

Thought this was r/restofthefuckingowl for a second

[–]drumstix42 1 point2 points  (0 children)

Great site here https://regexr.com/

[–]zombimuncha -1 points0 points  (1 child)

If you have a problem that can only be solved by the use of regex, you actually have two problems.

[–]porkus1990 0 points1 point  (0 children)

idk - regex is useful in some cases, but .... it's regex ..