CppVerbalExpressions alternatives and similar libraries
Based on the "Miscellaneous" category.
Alternatively, view CppVerbalExpressions alternatives based on common mentions on social networks and blogs.
-
ZXing
ZXing ("Zebra Crossing") barcode scanning library for Java, Android -
RE2
RE2 is a fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python. It is a C++ library. -
ZBar
Clone of the mercurial repository http://zbar.hg.sourceforge.net:8000/hgroot/zbar/zbar -
American fuzzy lop
american fuzzy lop - a security-oriented fuzzer -
Serial Communication Library
Cross-platform, Serial Port library written in C++ -
Better Enums
C++ compile-time enum to string, iteration, in a single header file -
c-smart-pointers
Smart pointers for the (GNU) C programming language -
Mach7
Functional programming style pattern-matching library for C++ -
Experimental Boost.DI
DI: C++14 Dependency Injection Library -
UNITS
a compile-time, header-only, dimensional analysis and unit conversion library built on c++14 with no dependencies. -
constexpr-8cc
Compile-time C Compiler implemented as C++14 constant expressions -
cxx-prettyprint
A header-only library for C++(0x) that allows automagic pretty-printing of any container. -
outcome
Provides very lightweight outcome<T> and result<T> (non-Boost edition) -
libcpuid
a small C library for x86 CPU detection and feature extraction -
kangaru
🦘 A dependency injection container for C++11, C++14 and later -
value-category-cheatsheet
A C++14 cheat-sheet on lvalues, rvalues, xvalues, and more -
casacore
Suite of C++ libraries for radio astronomy data processing -
neither
Either and Maybe monads for better error-handling in C++ ↔️ -
ub-canaries
collection of C/C++ programs that try to get compilers to exploit undefined behavior -
StrTk
C++ String Toolkit Library https://www.partow.net/programming/strtk/index.html -
QtVerbalExpressions
This Qt lib is based off of the C++ VerbalExpressions library. [MIT] -
access_profiler
a tool to count accesses to member variables in c++ programs -
libsigc++
A typesafe callback system for standard C++. [LGPL] -
FastFormat
The fastest, most robust C++ formatting library -
cppq
Simple, reliable & efficient distributed task queue for C++17 -
CommonPP
Small library helping you with basic stuff like getting metrics out of your code, thread naming, etc.
Write Clean C++ Code. Always.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of CppVerbalExpressions or a related project?
README
CppVerbalExpressions
C++ Regular Expressions made easy
VerbalExpressions is a C++11 Header library that helps to construct difficult regular expressions.
This C++ lib is based off of the (original) Javascript VerbalExpressions library by jehna.
Other Implementations
You can see an up to date list of all ports on VerbalExpressions.github.io.
How to get started
In case you do not have C++11 compliant standard library you can still use boost.regex.
Examples
Here's a couple of simple examples to give an idea of how VerbalExpressions works:
Testing if we have a valid URL
// Create an example of how to test for correctly formed URLs
verex expr = verex()
.search_one_line()
.start_of_line()
.then( "http" )
.maybe( "s" )
.then( "://" )
.maybe( "www." )
.anything_but( " " )
.end_of_line();
// Use verex's test() function to find if it matches
std::cout << expr.test("https://www.google.com") << std::endl;
// Ouputs the actual expression used: ^(?:http)(?:s)?(?:://)(?:www.)?(?:[^ ]*)$
std::cout << expr << std::endl;
Replacing strings
// Create a test string
std::string replaceMe = "Replace bird with a duck";
// Create an expression that seeks for word "bird"
verex expr2 = verex().find("bird");
// Execute the expression
std::cout << expr2.replace(replaceMe, "duck") << std::endl;
Shorthand for string replace:
std::cout << verex().find( "red" ).replace( "We have a red house", "blue" ) << std::endl;
Here you can find the API documentation for Verbal Expressions
Basic usage
Basic usage of Verbal Expressions starts from the expression verex()
. You can chain methods afterwards. Those are described under the "terms" section.
auto expr = verex();
API
Terms
- .anything()
- .anything_but( const std::string & value )
- .something()
- .something_but(const std::string & value)
- .end_of_line()
- .find( const std::string & value )
- .maybe( const std::string & value )
- .start_of_line()
- .then( const std::string & value )
Special characters and groups
- .any( const std::string & value )
- .any_of( const std::string & value )
- .br()
- .linebreak()
- .range( const std::vector> & args )
- .range( const std::std::string & a, const & std::string b )
- .tab()
- .word()
Modifiers
- .with_any_case()
- .search_one_line()
- .search_global()
Functions
- .replace( const std::string & source, const std::string & value )
- .test()
Other
- .add( expression )
- .multiple( const std::string & value )
- .alt()