Attention! This is NOT related to Regex problem, matches the whole string instead of a part
Hi all. I try to do
Match y = Reg
My test regex was different from any others in the project's scope (thats what happens when Perl guy comes to C#), as it had no lookaheads/lookbehinds. So this discovery took some time.
Now, why we should call Regex behaviour undocumented, not undefined:
let's do some matches against "1.234567890"
.
(.)\.2345678
(.)(?=\.\d)
When you're doing a normal match, the result is copied from whole matched part of line, no matter where you've put the parentesizes; in case of lookaheads present, anything that did not belongs to them is copied.
So, the matches will return:
1.2345678
(at 2300, this looks like original string and I start yelling here at SO)1