|
see the messages above ...
|
|
|
|
|
is there any ISO standards for regular expressions?
diligent hands rule....
|
|
|
|
|
Maybe you can find a standard document. You might even find two, or three, or four - each of them standardizing some other variant.
In any case: The standard you (might) find, may be of little use: The tool you are using follows a different "standard". At least two or three variants can be labeled "widespread". If you hear anybody claim that there is a single dominating dominating variant, a proper reaction may be 'Oh, so that is the variant you are using?'
|
|
|
|
|
Obligatory XKCD[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
You mentioned Python shame on you
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
A moment of madness, I assure you - I throw myself on the mercy of the court!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Plea of madness accepted
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
But only because it is well documented!
|
|
|
|
|
thank you
diligent hands rule....
|
|
|
|
|
POSIX has a standard for them.
Beyond that, non-backtracking expressions (except character classes) are all standard
[]()*+.|
above are all standard
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
is this the standard you implemented your regex engine?
diligent hands rule....
|
|
|
|
|
It's implemented in FastFA which I linked you to in the comments of the one you were on.
It's best to use FastFA rather than the regex engine i wrote that you were looking at.
FastFA is faster, more complete, and supports unicode.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
|
You can't use my engine for that. Those are backtracking constructs.
You can use .NET's engine. It's slower, but backtracks.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
do you mean ".NET engine" is the one built in C#?
diligent hands rule....
|
|
|
|
|
Technically it's built into .NET, not C#, but yes you can use it from C#. It's the one you're thinking of.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
No. POSIX has some specifications, but there's no guarantee all flavors will care about POSIX compliance. Also, there's basic and extended matching, which adds another layer of blah. However, PCRE is so popular that that's also a good one to adhere to. Even JS should be ok 99% of the time if you learn PCRE. But, keep in mind there's also PCRE1 and PCRE2, so referring to PCRE1 in particular, but you should know both.
Couple of sites to always use to help with the learning curve:
Regular Expressions Reference Table of Contents
regex101: build, test, and debug regex
Regex 101 is awesome, it'll allow you to choose the flavor/engine you're working with, out of the most popular ones.
In short, learn PCRE 1 and 2. That'll take you the furthest and a lot of engines just copied off that one anyway.
Jeremy Falcon
|
|
|
|
|
diligent hands rule....
|
|
|
|
|
Stored with the Lost Ark probably.
I use the implementation in .net, which means knowing not only the Regular Expression syntax, but the classes which use them as well.
modified 5-Oct-23 11:06am.
|
|
|
|
|
Official is no help if you're using an unofficial engine.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
Just noting that java, C# and javascript all use a subset of the Perl regex.
I think at least one of the other languages (python, ruby) also uses that.
The Dragon Book ("Compilers Principles, Techniques and Tools") defines a very limited regular expression language which is then used throughout the book.
|
|
|
|
|
diligent hands rule....
|
|
|
|
|
Whichever engine you are using, if you are doing fairly complicated regex expressions…
Create a lot of positive and negative test cases for your uses. That way if you ever port it or upgrade the regex engine, you will know it is still working.
I upgraded one toolset on Windows that totally changed how it handled \r\n line termination between versions. I wrote all of my test cases once I realized the mess that update created.
|
|
|
|
|
thanks for great tips
diligent hands rule....
|
|
|
|