in reply to Re: Why doesn't this regex work? ( lookaround backtracking pos)
in thread Why doesn't this regex work? (Solved!)
there is one \s and it is outside of the lookaround ... so its checking every other number
BINGO! Thank you.
If I put the first space into a lookbehind: s[(?<=\s)(\d+)\d\K\s(?=(\d+)\d\s)]{
Or substitute the zero length \b--which will serve the same purpose: s[\b(\d+)\d\K\s(?=(\d+)\d\s)]{
The substitution works as I wanted it to.
But damn I could not see that for looking.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Why doesn't this regex work? ( lookaround dynamic postponed pattern (??{ code })
by Anonymous Monk on Aug 15, 2013 at 12:08 UTC | |
by BrowserUk (Patriarch) on Aug 15, 2013 at 12:44 UTC |