Yes the description is not that great and I was going to ask for some update.
Quote:
F - make back-references refer to () capture groups, which is how standard regex works.
seems to indicate that before that, backreference were not referring to the () capture group, but they were. The problem before was that mIRC was ignoring non participating capturing group. I think this is what /F should mention, but maybe it was said that way to keep it simple, but really I would like to see:

Quote:
F - Stop ignoring non participating capturing group, which is how standard regex works

Because the current description is complete non sense actually, backreference always refer to capture group.

The Note: about /F in the help file is, the same way, a bit wrong I think.
First, there is a difference between an empty match and a non participating capturing group
/([a-z]*)/ on "2" is creating an empty capturing group, which mirc handled and is still handling correctly regardless of the /F switch, but /([a-z])*2/ on "2" is creating a non participating capturing group, which is ignored without the F switch, a value for it would be $null, but it's changing the total number of capture overall $regml(0) (or $regmlex), which is more problematic.
Second, mIRC has no control as to how \N backreferences are used/handled in the pattern, backreference in the pattern should work the same regardless of /F.
Only N indexes in identifier such as $regml is going to change.

So maybe it should says
Quote:
If the F modifier is not used, non participating capturing group are ignored.
but that's very redundant.

As shown here, when you get a non participating capturing group, you get -1 -1 for the offset/position.
I'm not too sure how useful it is to know if a capturing group participated to the match but maybe a new property could be added to $regml/$regmlex.





Last edited by Wims; 29/06/17 02:09 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel