I hate RegEx

Mashiane

Expert
Licensed User
Longtime User
Ola


I think this is one of the areas in my coding world that I have not mastered.

Rather cool:


 

agraham

Expert
Licensed User
Longtime User
I've never managed to get my head around regex - my mind seems not to be built for it. :(

The bible on regex, including how they are implemented is

Mastering Regular Expression 3rd Edition by Jeffrey E. F. Friedl. ISBN: 978-0596528126

I've started reading it several times but it's never really 'clicked' properly. :confused:
 

aeric

Expert
Licensed User
Longtime User
One doesn’t need to like it. Just Google search how to use it. ?
 

agraham

Expert
Licensed User
Longtime User
will take you maybe 20 minutes
No it won't for some people. I've tried on and off for years but the understanding never comes. I can manage complex logic but I could never 'see' regexes, though I know some people can use them apparently intuitively.
 

ilan

Expert
Licensed User
Longtime User
No it won't for some people. I've tried on and off for years but the understanding never comes. I can manage complex logic but I could never 'see' regexes, though I know some people can use them apparently intuitively.

have a look at this guy and maybe your opinion will change :)

 

Peter Simpson

Expert
Licensed User
Longtime User
I think this is one of the areas in my coding world that I have not mastered.
SNAP, I totally agree.

Most of the time when I know that the best solution for filtering/checking text is to use RegEx, the first thing I do is to check big brother G to see if the expression that I need is already out there. If I sadly can't find the Regular Expression that I'm looking for, I then do one of two things to help me create it.
  • Use one of the many free website to help me create/test my butchered RegEx
  • Or I use one of the many free Android apps on the play store to help me create/test my butchered RegEx
Either way it's usually a butchered expression that works. In the past I've spent an hour or two creating and testing an extremely simple RegEx as my mind has huge problems when it comes to Regular Expressions ;)
 

TILogistic

Expert
Licensed User
Longtime User
I just have to say that I have used it for many years in different application development languages and it is really useful if you want to do complex validations.

and in database it is very useful to use.

sample:

and unix / linux

Sample AWK.
 
Last edited:

Sandman

Expert
Licensed User
Longtime User
Cant we just write RegEx in our native languages. "In this word find x then replace with y, after you check if the sentence has numbers.... ?" LOL
It's a fair question, and these easy-to-understand documents and links will discuss this in simple terms that everybody can easily understand after a quick read*:

”Generating Regular Expressions from Natural Language Specifications: Are We There Yet?”

”SoftRegex: Generating Regex from Natural Language Descriptions using Softened Regex Equivalence”

”Is there a regular language to represent regular expressions?”


This might actually be helpful to you, going the other direction:

* Joke
 

aeric

Expert
Licensed User
Longtime User
It's a fair question, and these easy-to-understand documents and links will discuss this in simple terms that everybody can easily understand after a quick read*:

”Generating Regular Expressions from Natural Language Specifications: Are We There Yet?”

”SoftRegex: Generating Regex from Natural Language Descriptions using Softened Regex Equivalence”

”Is there a regular language to represent regular expressions?”


This might actually be helpful to you, going the other direction:

* Joke
If I could understand the above, I can go for a doctorate study. ?
 

AnandGupta

Expert
Licensed User
Longtime User
Looks like I am minority here.

I use regex to find and replace in my text editor UltraEdit and also use TextCrawler (older version) to fine tune my regular expression.
Now we have tons of online options too to help in getting the right regular expression.
 
Top