Next Regular Expression Mastery 57

Backreferences

/(\d{1,3}\.){3}(\d{1,3})/

Start copying, copy the 130 into $1, stop copying, repeat
Start copying, copy the 91 into $1, stop copying, repeat
Start copying, copy the 6 into $1, stop copying, go on
Start copying, copy the 1 into $2, stop copying, end of string


Next Copyright © 2002 M. J. Dominus