Bug 7587 - .NET counts Regex.Match index position as start of line. mono's implementation does not.
Summary: .NET counts Regex.Match index position as start of line. mono's implementatio...
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-10-02 10:45 UTC by Tom Hindle
Modified: 2014-11-23 23:07 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test case showing bug. (416 bytes, text/x-csharp)
2012-10-02 10:45 UTC, Tom Hindle
Details
parser loop that fails on linux but not on windows (1.62 KB, text/plain)
2012-12-02 17:51 UTC, Jonas Widarsson
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Tom Hindle 2012-10-02 10:45:48 UTC
Created attachment 2669 [details]
Test case showing bug.

The following fails to produce a match running with mono's Regex implementaiton.

var pattern = @"(^)a";
regex.Match("  a", 2, 1);

Attached test case showing issue.

Expected result of test case:
True
2

Actual result of test case:
False
0
Comment 1 Jonas Widarsson 2012-12-02 17:51:13 UTC
Created attachment 3044 [details]
parser loop that fails on linux but not on windows
Comment 2 Jonas Widarsson 2012-12-02 17:53:54 UTC
Comment on attachment 3044 [details]
parser loop that fails on linux but not on windows

Same problem, but a real world example provided.

Expected result:
At pos: 0 with subject: '123abc'
reNumbers matched
At pos: 3 with subject: 'abc'
reLetters matched
SUCCESS

Result on linux:
At pos: 0 with subject: '123abc'
reNumbers matched
At pos: 3 with subject: 'abc'
FAILURE
Comment 3 Miguel de Icaza [MSFT] 2014-11-23 23:07:24 UTC
Fixed with the new .net code