In article <[EMAIL PROTECTED]>, Phil Carmody <[EMAIL PROTECTED]> writes: > This is a real world task which can be solved in a couple of lines. > Which makes me think that you guys can do it in about half a line! > > The simple version of the task is to verify that each line of a file is the > insertion of one character somewhere (maybe at the start or the end) into the > prior line. > > So > <<< > 1 > 12 > 132 > x132 >>>> > would be accepted, but > <<< > 1 > 12 > 132 > alien132 >>>> > would not be accepted.
Regex is always nice: -p0 $_ x=/^((.*)(.*) (?=\2.\3 |$))*$/