For example, /(\w+) (?:\+) (\w)/
that regexp must return 2.
I must apologize for an incomplete question. Here’s the problem: Input is XML-file (in fact it does not matter :), which sets rules for strings. At the moment it looks like this:
<string svars="3">(?:total ?|)(\d{1,2}(?:[\.,]\d{1,2}|))\/(\d{1,2}(?:[\.,]\d{1,2}|))\/(\d{1,2}(?:[\.,]\d{1,2}|))\s?sq\.\s?m\.?</string>
Need to get rid of the variable svars, and count the number of substitution vars is in the regex programmatically.
I think you are looking for YAPE::Regex: