[Mono-bugs] [Bug 577346] Regex constructor throws ArgumentException: range in reverse order

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Feb 25 20:09:11 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=577346

http://bugzilla.novell.com/show_bug.cgi?id=577346#c1


Miguel de Icaza <miguel at novell.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |miguel at novell.com

--- Comment #1 from Miguel de Icaza <miguel at novell.com> 2010-02-26 01:09:11 UTC ---
Incredibly annoying.

The documentation for this class states that octal values need to be preceded
with a \0, \177 is not a valid escape sequence.

But Microsoft's implementation allows that to be parsed as an octal value, even
if it introduces an ambiguity between back-references (\N, like \1) and actual
embedded octal values.

Not quite sure how to address this problem of the ambiguity, since Microsoft's
Regex allows this and produces true:

var r = new Regex ("\\14");
var res = r.Match ("\x0c").Success;

res is true here.

Microsoft seems to consider \1 to \9 as back references, and interprets things
like \10 as a backreference if there are at least 10 groups in the regex.

As a separate issue I found what looked like a bug, but it turns out that it is
sort of a featurelet: octal values are being limited to 2 digits after 0 if the
first digit is not '1'.

So this: @"\0240" needs to become 20, 48, 48.

This explains part of the change done in 2005 in charge 38517, but that change
is not complete.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list