in reply to split on zero-length pattern
perl -lwe 'use strict; print(join("/",split(/(?!\.\d)/,"123.456.78.1")))'In your code you have a negative look-ahead assertion (?!\.\d).
The idea is that a split point is any point in the string which is preceeded by a dot followed by a digit.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: split on zero-length pattern
by rovf (Priest) on Nov 26, 2010 at 11:16 UTC | |
by tinita (Parson) on Nov 26, 2010 at 11:30 UTC | |
by rovf (Priest) on Nov 26, 2010 at 12:39 UTC |