Click here to Skip to main content
15,881,898 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Who is afraid of regex? Pin
Gerry Schmitz3-Jan-21 3:52
mveGerry Schmitz3-Jan-21 3:52 
GeneralRe: Who is afraid of regex? Pin
honey the codewitch3-Jan-21 3:59
mvahoney the codewitch3-Jan-21 3:59 
GeneralRe: Who is afraid of regex? Pin
Chris Maunder3-Jan-21 3:59
cofounderChris Maunder3-Jan-21 3:59 
GeneralRe: Who is afraid of regex? Pin
honey the codewitch3-Jan-21 4:15
mvahoney the codewitch3-Jan-21 4:15 
GeneralRe: Who is afraid of regex? Pin
trønderen3-Jan-21 4:31
trønderen3-Jan-21 4:31 
GeneralRe: Who is afraid of regex? Pin
trønderen3-Jan-21 4:40
trønderen3-Jan-21 4:40 
GeneralRe: Who is afraid of regex? Pin
Gary R. Wheeler3-Jan-21 4:56
Gary R. Wheeler3-Jan-21 4:56 
GeneralRe: Who is afraid of regex? Pin
honey the codewitch3-Jan-21 5:18
mvahoney the codewitch3-Jan-21 5:18 
I think it depends. I generally agree that complicated regex is mug's game. However,

How do you technically, and accurately convey a set of rules around lexical requirements?

Such rules must be able to be conveyed to other developers precisely.

Such rules must be unambiguous, and testable.

Such rules must be absorbable in reasonable amount of time, meaning no poring over RFCs if one can avoid it.

Imagine conveying the rules for what constitutes a JSON number

You can either say:
(\-?)(0|[1-9][0-9]*)((\.[0-9]+)?([Ee][\+\-]?[0-9]+)?)


Which takes some unpacking as you say, but is certainly readable.

Or I can give you a page long document of requirements around JSON number parsing.

Personally, I can read that quite easily, but that's me.

Let me propose something - there is a meaningful subset of regular expressions which are easy to understand, and can fulfill most simple lexical specifications like the above, or say, like an email address, or an url, or any number of small, structured text fragments.

It beats the alternative, hands down.
Real programmers use butterflies


modified 3-Jan-21 11:31am.

GeneralRe: Who is afraid of regex? Pin
Gary R. Wheeler3-Jan-21 6:10
Gary R. Wheeler3-Jan-21 6:10 
GeneralRe: Who is afraid of regex? Pin
honey the codewitch3-Jan-21 7:49
mvahoney the codewitch3-Jan-21 7:49 
GeneralRe: Who is afraid of regex? Pin
honey the codewitch3-Jan-21 8:21
mvahoney the codewitch3-Jan-21 8:21 
GeneralRe: Who is afraid of regex? Pin
Gary R. Wheeler3-Jan-21 9:25
Gary R. Wheeler3-Jan-21 9:25 
GeneralRe: Who is afraid of regex? Pin
Slacker0073-Jan-21 6:48
professionalSlacker0073-Jan-21 6:48 
GeneralRe: Who is afraid of regex? Pin
Ralf Peter Lucke3-Jan-21 20:54
Ralf Peter Lucke3-Jan-21 20:54 
GeneralRe: Who is afraid of regex? Pin
#realJSOP3-Jan-21 5:34
mve#realJSOP3-Jan-21 5:34 
GeneralRe: Who is afraid of regex? Pin
honey the codewitch3-Jan-21 7:50
mvahoney the codewitch3-Jan-21 7:50 
GeneralRe: Who is afraid of regex? Pin
#realJSOP3-Jan-21 7:56
mve#realJSOP3-Jan-21 7:56 
GeneralRe: Who is afraid of regex? Pin
honey the codewitch3-Jan-21 8:24
mvahoney the codewitch3-Jan-21 8:24 
GeneralRe: Who is afraid of regex? Pin
Sander Rossel3-Jan-21 23:02
professionalSander Rossel3-Jan-21 23:02 
GeneralRe: Who is afraid of regex? Pin
honey the codewitch4-Jan-21 2:52
mvahoney the codewitch4-Jan-21 2:52 
GeneralRe: Who is afraid of regex? Pin
Thomas Stockwell4-Jan-21 5:08
professionalThomas Stockwell4-Jan-21 5:08 
GeneralRe: Who is afraid of regex? Pin
Matt McGuire5-Jan-21 5:21
professionalMatt McGuire5-Jan-21 5:21 
GeneralNo Post matches the given query in django Error Pin
k3 v1n2-Jan-21 17:32
k3 v1n2-Jan-21 17:32 
GeneralRe: No Post matches the given query in django Error Pin
Rick York2-Jan-21 17:45
mveRick York2-Jan-21 17:45 
GeneralRe: No Post matches the given query in django Error Pin
OriginalGriff2-Jan-21 21:31
mveOriginalGriff2-Jan-21 21:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.