in reply to Modifying the match position after each match
use strict; use locale; my $string = "_'nada_komo_el_'sol_"; $string =~ s/(_)([^'])/$1'$2/g; print $string; __END__ _'nada_'komo_'el_'sol_
Update: or even:
$string =~ s/(_)[^']/$1'/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Modifying the match position after each match
by ikegami (Patriarch) on Mar 23, 2010 at 21:44 UTC | |
|
Re^2: Modifying the match position after each match
by pat_mc (Pilgrim) on Mar 24, 2010 at 08:43 UTC |