Hello, @hans-dampf, @Alan-kilborn @andrecool-68 and All,
@hans-dampf, I strongly advice you to study the regexes’s world , beginning with the excellent tutorial of the Regular-Expressions.info site, below :
https://www.regular-expressions.info/tutorialcnt.html
It will certainly take you a few weeks to get an overview of the syntax of regular expressions, but it’s really worth it. ;-))
If you are in a hurry, see this part :
https://www.regular-expressions.info/shorthand.html
Moreover, regarding your second regex construction (?<=text":")*(","), this syntax seems incorrect as the quantifier *, meaning repeated 0 or more times should be, either, preceded with a character, like s*, an expression embedded with parentheses like (123)*, a character class, like [abc]* or a shorthand class, like \h*. But, it should not follow a look-behind construction !
However, I was really surprised that our Boost regex engine does not consider it as invalid !?
To explain this behavior, let us, first, consider the simple regex (?<=abc)def which searches for the string def only if preceded with the string abc. If you add the same look-behind, giving the regex (?<=abc)(?<=abc)def it will do the same search, because look-arounds are just zero-length assertions and because they both refer about the same condition !
You could add as many identical look-behind to get the same result ( For instance (?<=abc)(?<=abc)(?<=abc)(?<=abc)(?<=abc)def would match any string def, if preceded with the string abc ! )
Indeed, the *, right after the look-behind, is taken as a real quantifier. As consecutive values are useless, the unique interesting case seems to be (?<=abc)?def which would search for the string def OR for the string def only if preceded with the string abc. Of course, due to Boole algebra, this regex could just be simplified as the search of def ;-))
To be convinced you of that fact, consider the text, below :
1 ","
2 text":"","
3 ABCD":"","
The regexes "," or (?<=text":")*"," or (?<=text":")?"," would find the string ",", in the three lines
The regexes (?<=text":")"," or (?<=text":")+"," or (?<=text":"){1}"," or (?<=text":"){10}"," would find the string "," in line 2 only
Best Regards,
guy038