Quick Example
Compile a pattern, scan text, and process the first match:
#include <erbsland/all_re.hpp>
#include <iostream>
#include <string>
using namespace erbsland::re;
int main() {
try {
const auto re = RegEx::compile(R"(\d+)");
const auto text = std::string{"abc 12345 xyz"};
if (const auto match = re->findFirst(text); match != nullptr) {
std::cout << "Found a number: " << match->content(0) << "\n";
}
} catch (const Error &error) {
std::cerr << error.what() << "\n";
return 1;
}
return 0;
}