Quantcast
Channel: C++11 Regular Expression
Viewing all articles
Browse latest Browse all 11

C++11 Regular Expression

$
0
0

Syed Babu wrote:

I'm unable to understand how the s1.size and s2.size differs as both  are searching for same match.

What do you mean, the same? The two regular expressions are clearly  different.

s1.size() and s2.size() do not, I repeat do not, return the length of  the match in characters (as you seem to assume, despite being told  otherwise - twice). They return the number of submatches, which is one  plus the number of capture groups in the regular expression. If you want  the length of the match, that would be s1.length() and s2.length()


Igor Tandetnik


Viewing all articles
Browse latest Browse all 11

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>