in reply to Why doesn't this regex work? (Solved!)
Its output is very long, but as you know what the regex should do, you might understand it.use re 'debug';
Update: It seems your example data miss a digit at the end of each number. I tried it with a different data:
2120 2140 2180 2197 2200 2203 2205 2234 2238 2259 2280 2299 2401
If I understood your specification, the following should do the work, being a bit more readable:
s/\b(\d*)(\d\d) (?=\1\d\d\b)/$1$2_/g; s/ /\n/g; s/_/ /g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why doesn't this regex work?
by BrowserUk (Patriarch) on Aug 15, 2013 at 10:11 UTC |