#include <iostream>
#include <regex>
using namespace std;
void show_matches(const std::string& in, const std::string& re)
{
std::smatch m;
std::regex_search(in, m, std::regex(re));
if (!m.empty())
{
std::cout << "input=[" << in << "], regex=[" << re << "]\n "
"prefix=[" << m.prefix() << "]\n smatch: ";
for (std::size_t n = 0; n < m.size(); ++n)
std::cout << "m[" << n << "]=[" << m[n] << "] ";
std::cout << "\n suffix=[" << m.suffix() << "]\n";
}
else
std::cout << "input=[" << in << "], regex=[" << re << "]: NO MATCH\n";
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
char str[] = "annex32_1.47.5";
if(regex_search(str,regex("annex")))
Serial.println("match");
else
Serial.println("not match");
show_matches("abcdefghi", "a[a-z]{2,4}");
String pippo = "azazzerellabis";
show_matches(pippo.c_str(), "gg(azaz)(zere)");
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}
esp:0
esp:2
esp:4
esp:5
esp:12
esp:13
esp:14
esp:15
esp:16
esp:17
esp:18
esp:19
esp:21
esp:22
esp:23
esp:25
esp:26
esp:27
esp:32
esp:33
esp:34
esp:35
esp:3V3
esp:EN
esp:VP
esp:VN
esp:GND.1
esp:D2
esp:D3
esp:CMD
esp:5V
esp:GND.2
esp:TX
esp:RX
esp:GND.3
esp:D1
esp:D0
esp:CLK