DREGX is a Regex Fuzzer and Analyzer for C++. There are little regex fuzzers and analyzers for C++ which allow the user to deeply understand relations between various regexes. DREGX makes it easy to understand and test regexes.
DREGX uses CMake for installation. Make sure you have the latest version of CMake installed. You can install it here: https://cmake.org/download/
git clone https://github.com/Deruago/DREGX
cd ./DREGX
mkdir build
cd build
cmake ..
cmake --build . --target install
#include "Deamer/Dregx/Fuzzer.h"
#include <iostream>
int main()
{
auto fuzzer = ::deamer::dregx::Fuzzer();
fuzzer.SetRegex("[a-zA-Z]+");
auto example = fuzzer.GetMinimalExample();
// output: a
std::cout << "output: " << example << "\n";
return 0;
}
#include "Deamer/Dregx/Analyzer.h"
#include <iostream>
int main()
{
auto analyzer = ::deamer::dregx::Analyzer();
analyzer.SetRegex("[a]+");
bool isSubset = analyzer.IsRegexSubsetOf("[a-zA-Z]+");
// output: true
std::cout << std::boolalpha;
std::cout << "output: " << isSubset << "\n";
return 0;
}
See the Deamer Documentation repo: https://github.com/Deruago/DeamerDocumentation