Here is what I want to achieve in terms of regex matching :
If I am correctly translated the regex expression to match the syntax of Nick Gammon's regexp library (v1.2), it would look like this : "&([%w%d%-]*)=([%w%d%.,%-]*)"
But this does not work somehow. It is only matching on the first occurence of the pattern and the rest are ignored.
To debug what is matched here is my simple code:
MatchState ms;
ms.Target(topic);
// Escape char for this library is %
char result = ms.Match("&([%w%d%-_]*)=([%w%d%.,%-_]*)");
if (result == REGEXP_MATCHED)
{
SerialPrintln("C2D topic parsing result :");
char buf[100];
for (int j = 0; j < ms.level; j++)
{
Serial.print("Capture number: ");
Serial.println(j, DEC);
Serial.print("Text: '");
Serial.print(ms.GetCapture(buf, j));
Serial.println("'");
}
}
For the test string included in regex101's link above, this is the output :