in reply to Re^3: Regex Question
in thread Regex Question
for my $field ( map $_, 'C/O', '2/4', 'C/2', 'd/l', '2/', '/2') { print "$field..."; $field =~ s/ (?<!C(?=.O)) # Look back a character and make sure it's not C-so +mething-O from there (?<!\d(?=.\d)) # Make sure it's also not a digit-something-digit (?:\\|\/) # The something is a slash or backslash / & /xgi; print "$field\n"; }
|
|---|