archo5 / sgregex Goto Github PK
View Code? Open in Web Editor NEWRegular expression library
License: MIT License
Regular expression library
License: MIT License
I'm testing a few "real world" regex's from regexlib.com.
This "dutch-style phone number" regex does not match "023-5256677" but it should.
(^+[0-9]{2}|^+[0-9]{2}(0)|^(+[0-9]{2})(0)|^00[0-9]{2}|^0)([0-9]{9}$|[0-9-\s]{10}$)
It works on these:
Matches
+31235256677 | +31(0)235256677
Non-Matches
+3123525667788999 | 3123525667788 | 232-2566778
Hi,
I am just evaluating a small C regex library and found your project. Thanks for that project!
However, I have a problem, that the matching process crashes:
Assertion failed: (R->captures[ 0 ][1] != RX_NULL_OFFSET), function srx_MatchExt, file sgregex.c, line 1218.
' like 'GET|POST'+Abort
You can reproduce this, if you add the following line in sgregex_test.c in the MATCHTEST section:
MATCHTEST("GET /index.html HTTP/1.1\r\n", "GET|POST", 1);
If you add group parentheses, it works:
MATCHTEST("GET /index.html HTTP/1.1\r\n", "(GET|POST)", 1);
Although "GET|POST" is a valid regex, it crashes.
Thanks for your support.
I'm testing a few "real world" regex's from regexlib.com.
This "US currency" regex does not match "$1,234,567.89" but it should.
^$([0-9]{1,3}(,[0-9]{3})*|([0-9]+))(.[0-9]{2})?$
It works on these:
Matches
$0.84 | $123458
Non-Matches
$12,3456.01 | 12345 | $1.234
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.