Click here to Skip to main content
15,891,976 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: I dreamed my cat had an API Pin
oofalladeez34327-Dec-21 7:45
professionaloofalladeez34327-Dec-21 7:45 
GeneralRe: I dreamed my cat had an API Pin
LeahAtWork27-Dec-21 8:14
professionalLeahAtWork27-Dec-21 8:14 
JokeRe: I dreamed my cat had an API Pin
Kris Lantz27-Dec-21 8:56
professionalKris Lantz27-Dec-21 8:56 
GeneralRe: I dreamed my cat had an API Pin
Gary R. Wheeler27-Dec-21 9:17
Gary R. Wheeler27-Dec-21 9:17 
GeneralRe: I dreamed my cat had an API Pin
Nick Polyak28-Dec-21 5:42
mvaNick Polyak28-Dec-21 5:42 
GeneralRe: I dreamed my cat had an API Pin
willichan28-Dec-21 9:32
professionalwillichan28-Dec-21 9:32 
GeneralRe: I dreamed my cat had an API Pin
Roger Wright28-Dec-21 11:56
professionalRoger Wright28-Dec-21 11:56 
QuestionRegex syntax zoo Pin
honey the codewitch27-Dec-21 0:18
mvahoney the codewitch27-Dec-21 0:18 
I decided to start shoring up the regular expression syntax I use, and settling on something I can more readily document and hopefully mimics what's already out there because I don't want people to have to learn new things just to use my engine.

This is a lot harder than it sounds. For starters most modern engines do backtracking, trading speed and simplicity for expressive power. Mine is simple and fast, but lacks some of the expressive power, which at the end of the day means I can't support certain language constructs - because they require backtracking which my engine doesn't do.

I'm not looking to change that, particularly when my engines are as much as 3 times as fast as Microsoft's .NET regex, and can readily be used for tokenization as a result.

But this leaves me with something of a conundrum.

There are 3 or 4 major regex syntax varieties out there. POSIX, Perl, JS, .NET etc.

I've started with POSIX historically, because it actually means I can use it with certain tools I use - things like FLEX use a POSIXish syntax.

I think I'd like to continue that, but I've noticed, I don't actually need that much POSIX specific nonsense to support almost all FLEX inputs in practice.

I hope I haven't lost or bored you yet. Bear with me.

I'm loathe to add to the syntax nightmare that is regex, so I want to be very careful here.

I'd rather not support multiple "modes" to support different syntax styles like .NET's engine does.

However, I'm thinking of, as much as possible, creating "one syntax to rule them all" as much as I can, such that I can accept constructs allowable in any engine, where possible.

One part of me wants to strangle the other part of me in my sleep for even considering this. /s

The other part of me wonders what the alternative to this mega-syntax is.

90% of this has to do with what is allowed to appear inside [] braces.

Any ideas?
Real programmers use butterflies

AnswerRe: Regex syntax zoo Pin
Kornfeld Eliyahu Peter27-Dec-21 0:53
professionalKornfeld Eliyahu Peter27-Dec-21 0:53 
GeneralRe: Regex syntax zoo Pin
Daniel Pfeffer27-Dec-21 4:56
professionalDaniel Pfeffer27-Dec-21 4:56 
JokeRe: Regex syntax zoo Pin
Daniel Pfeffer27-Dec-21 4:53
professionalDaniel Pfeffer27-Dec-21 4:53 
GeneralRe: Regex syntax zoo Pin
honey the codewitch27-Dec-21 5:02
mvahoney the codewitch27-Dec-21 5:02 
AnswerRe: Regex syntax zoo Pin
Gerry Schmitz27-Dec-21 5:31
mveGerry Schmitz27-Dec-21 5:31 
GeneralRe: Regex syntax zoo Pin
honey the codewitch27-Dec-21 5:40
mvahoney the codewitch27-Dec-21 5:40 
GeneralRe: Regex syntax zoo Pin
YahiaEQ27-Dec-21 20:11
YahiaEQ27-Dec-21 20:11 
GeneralRe: Regex syntax zoo Pin
honey the codewitch27-Dec-21 21:20
mvahoney the codewitch27-Dec-21 21:20 
GeneralRe: Regex syntax zoo Pin
Cpichols28-Dec-21 1:29
Cpichols28-Dec-21 1:29 
AnswerRe: Regex syntax zoo Pin
Bruce Patin28-Dec-21 6:01
Bruce Patin28-Dec-21 6:01 
GeneralRe: Regex syntax zoo Pin
honey the codewitch28-Dec-21 7:01
mvahoney the codewitch28-Dec-21 7:01 
AnswerRe: Regex syntax zoo Pin
David On Life28-Dec-21 17:42
David On Life28-Dec-21 17:42 
GeneralRe: Regex syntax zoo Pin
honey the codewitch29-Dec-21 0:14
mvahoney the codewitch29-Dec-21 0:14 
GeneralRe: Regex syntax zoo Pin
David On Life31-Dec-21 6:11
David On Life31-Dec-21 6:11 
GeneralRe: Regex syntax zoo Pin
honey the codewitch31-Dec-21 6:52
mvahoney the codewitch31-Dec-21 6:52 
GeneralRe: Regex syntax zoo Pin
David On Life31-Dec-21 20:24
David On Life31-Dec-21 20:24 
GeneralRe: Regex syntax zoo Pin
honey the codewitch31-Dec-21 21:23
mvahoney the codewitch31-Dec-21 21:23 

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.