ccxvii / minilibs Goto Github PK
View Code? Open in Web Editor NEWVarious small libraries.
Various small libraries.
gcc7, in its infinite braindeadedness, warns when a switch's case statement will fall through, and this causes 1 warning in regexp.c:
egexp.c:125:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
case 0: die("unterminated escape sequence");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In this case it's trivial to solve by adding:
; return 0
after the call to die()
. It won't ever return, so the return is harmless.
That said: the use of die()
makes this code ill-suited for use in a library :( - we can't kill the app just because a user inputs an invalid regex:
[stephan@host:~/cvs/minilibs]$ ./test_regexp.exe '\bbl(e+)p\b\' 'foo bar bleep baz bleeeeep'
regcomp: unterminated escape sequence
If you can tell that this code is public domain, MIT, or has a similar non-viral license, i will refactor it for use as a library and contribute the changes back to you.
i'm really interested in using your regex library in a piece of software but i can find no license for the sources anywhere in this tree, which means i can't include these sources in my (public domain) trees.
Can you please specify the license conditions for this code (ideally in each header file)?
Hello, can you make a small example for the regex please? I cannot seem to make this work...I am trying this and i expect that i
is 1, am I missing something? thanks.
const char *err = NULL;
Reprog *rep = regcomp((const char*)"[a-z]13", REG_ICASE, &err);
Resub sub;
int x = regexec(rep, "d13", &sub, REG_NOTBOL);
LE: it seems to work with "^[a-z]13"
. I have read that your regex uses JS flavour, but in JS ommitting the "^" is perfectly fine
In addranges_S
remove the addrange(0x9+1, 0xA-1);
line, it creates an invalid range, and isn't necessary.
As mentioned in #1 (comment) there's a newer version linked, that version has this removed as well.
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.