in reply to Perl regex. Why does this happen?
Why does this happen?
Because \s match all whitespace chars, including \n; thus \s{2} matches " \n" in your second line.
Based on the data you've provided, s[(\s{2})(?=\d)][2]g should do what you want.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl regex. Why does this happen?
by OneTrueDabe (Acolyte) on Jun 07, 2016 at 01:29 UTC | |
by AnomalousMonk (Archbishop) on Jun 07, 2016 at 04:02 UTC | |
by tye (Sage) on Jun 07, 2016 at 15:53 UTC |