Regex: /^(\d+)[^_]/gm
Test String: 12_34
I'd expect this regex not to match on test string, because \d+
is greedy eating the digits 1
and 2
and [^_]
fails on _
.
But it unexpected matches with only 1
in Group1. Where am I wrong?
I try to find a regular expression that matches the digits in test strings "12" or "12xx" but does not match on "12_xx"
Sample:
https://regex101.com/r/0QRTjs/1/
Dialect: In the end I'll use Microsoft System.Text.RegularExpressions.