in reply to Re: Replacing consecutive tokens in 1 pass
in thread Replacing consecutive tokens in 1 pass
ihbmy $string = "|90|93|foo|bar|91|92|95|96|906|"; my $result = join '|', map { s/^9[0-6]$/X/; $_ } split /\|/, $string, -1; print $result; __END__ |X|X|foo|bar|X|X|X|X|906|
|
---|