rpgillespie6 / posix-regex-cpp Goto Github PK
View Code? Open in Web Editor NEWA lightweight C++ syntax sugar wrapper for POSIX regex library commonly used in C
A lightweight C++ syntax sugar wrapper for POSIX regex library commonly used in C
group
passed as parameter to group()
, start()
or end()
equals pgroups.size()
, it leads to segmentation fault, because the vector pgroups
cannot access that index.g++ -Wall POSIXRegex.cpp
, some warnings are shown with message comparison between signed and unsigned integer expressions
. These warnings are in group()
, start()
and end()
functions.Suppose I have a regular expression "([A-Z]+)|([0-9]+)"
. So I want to match either alphabets or numeric characters. I compile this regex and give it a input string to match, say "HELLO"
.
When I try to see the matched groups, group(0) gives "HELLO"
, group(1) gives "HELLO"
, group(2) fails with segmentation fault with message terminate called after throwing an instance of 'std::out_of_range'. what(): basic_string::substr
.
Instead of directly returning substr
, first the start and end index for group must be checked and if they are equal to -1
, empty string should be returned.
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.