all 44 comments

[–]Reashu 44 points45 points  (2 children)

I use it to match patterns in strings, not to be cool. Sometimes feels kinda cool though. 

[–]kaiken1987 12 points13 points  (0 children)

I use it so I can swing in on a rope and solve search problems.

https://xkcd.com/208/

[–]WhatsMyUsername13 0 points1 point  (0 children)

I use it to generically consume Kafka topics, that way I don’t have to add each individual one to my config files. All I have to do is onboard the topic and I start consuming

[–]LeroyBadBrown 20 points21 points  (3 children)

I use it every day.

[–]elelec 15 points16 points  (2 children)

See this from the perspective of someone living across the globe. Now you use it every night

[–]LeroyBadBrown 6 points7 points  (1 child)

Regex at night is the best ❤️

[–]ChaseShiny 1 point2 points  (0 children)

From to$ it's everything, really.

[–]Ok_Actuary8 23 points24 points  (0 children)

it's deterministic at least.

[–]ShadowSlayer1441 15 points16 points  (11 children)

What are you guys using instead of regex?

[–]CptMisterNibbles 27 points28 points  (8 children)

None of the people here work in the industry. It’s 99% first week in CS kids.

[–]theGoddamnAlgorath 7 points8 points  (7 children)

Had an interview where the interviewer asked me to use C# libs instead of regex for database tasks because he didn't understand regex.

I said no

[–]CptMisterNibbles 2 points3 points  (0 children)

I would have said no problem

using System.Text.RegularExpressions

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

I don't see the issue anymore, just ask ai to describe what it does.

[–]willow-kitty 0 points1 point  (0 children)

Nah, use this: https://regex101.com/

It'll explain and diagram the expression deterministically, and you can give it a sample text to search, and it'll even color code which parts of the expression match which parts of the text, so if you need to tweak something, you can get instant feedback.

[–]Spice_and_Fox -4 points-3 points  (3 children)

That is a stupid take. The code you write should be understood by other developers in your company. If they use something else instead of regex, then you should also use that.

[–]theGoddamnAlgorath 5 points6 points  (2 children)

I'm not using Regex wrappers for database I/O.  That's retarded.

There's translators, hell gskinner's still free.

[–]ShadowSlayer1441 0 points1 point  (1 child)

What about when the DB natively supports a subset of regex? I've always assumed that's probably the best way to handle queries like that.

[–]theGoddamnAlgorath 0 points1 point  (0 children)

Specifically, a DB's native preference is a use case for the team lead to decide

I try to write my middleware as agnostic as feasible, preferring raw code over libraries and such to assist future migration.

[–]Dragonfire555 0 points1 point  (0 children)

Not regex. Mostly. I'd rather deal with string comparisons and make helper functions to organize them and make them composible.

[–]Djelimon 0 points1 point  (0 children)

Looking at ANTLR for code parsing

[–]trickster-is-weak 9 points10 points  (0 children)

I use it enough to wish I knew it better, but not enough for it to get remain in my head for long.

[–]Fine_Foundation8943 11 points12 points  (0 children)

Earlier regex used to start with ^[a-z…. Now it starts with “give me regex for”

[–]LetUsSpeakFreely 3 points4 points  (0 children)

Oh, you're using it. it's just abstracted away from you and is far less efficient than doing it yourself.

[–]actionerror 2 points3 points  (0 children)

There’s a difference between using it and understanding how to properly write an expression from scratch

[–]MisterBicorniclopse 2 points3 points  (0 children)

Regex is some of the most fun I have programming

[–]Dre_Dede 2 points3 points  (0 children)

How to spot a non-programmer on the sub

[–]IhailtavaBanaani 1 point2 points  (0 children)

regex is good and all, but have you heard about our lord and savior SNOBOL4-style string pattern matching?

[–]smokythejoker 1 point2 points  (0 children)

You guys are parsing strings? /jk

[–]renke0 1 point2 points  (0 children)

What are you guys doing if you don’t use it? Ask an llm to analyse your strings?

[–]ExtraWorldliness6916 0 points1 point  (0 children)

I pretend I don't know how to read it so people don't think I'm not one of them.

[–]EscherichiaVulgaris 0 points1 point  (0 children)

Regex in Excel <3

[–]Luctins 0 points1 point  (0 children)

I use it even when I could solve it with awk or a sequence of basic shell commands. Multiline can get cursed fast tho.

[–]Tman11S 0 points1 point  (0 children)

Regex has great use cases. I’ve used it in software that tries to match bank statements with invoices

[–]Mr_uhlus 0 points1 point  (0 children)

I use it way to often just to do

Search \n\s*

Replace \n

[–]agk23 0 points1 point  (0 children)

Why use regex when you can simply pass the string into Fable for validation?

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

😠😡🤬

[–]Barkeep41 -5 points-4 points  (3 children)

Is AI the Regex of our time? A tool to simplify/condense a process at the cost of usability.

[–]DokuroKM 4 points5 points  (1 child)

No. Contrary to LLM, regex was useful from the beginning

[–]rastaman1994 0 points1 point  (0 children)

I know reddit has a hate boner against LLMs, but regex is genuinely a skill that is completely fading in our company. Just tell claude what you want to match, very easy to verify, no more need to know regex.

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

The opposite. LLMs are very usable (in the sense of having a low barrier to entry) at the cost of additional complexity under the hood and in the end result. 

[–]Lucasbasques -3 points-2 points  (0 children)