ultranerds has asked for the wisdom of the Perl Monks concerning the following question:
Basically, we need to replace ? with ' , but ONLY when its NOT got a space *before* or *after* it. It needs to allow for foreign charachters too (as this is a french site :))my $test_string = "foo l?est sé?jou ? foo "; $test_string =~ s/([a-zA-Z0-9]+)\?([a-zA-Z0-9]+)/$1'$2/sig;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simple regex question
by kennethk (Abbot) on Sep 15, 2010 at 14:42 UTC | |
by ultranerds (Hermit) on Sep 15, 2010 at 14:48 UTC | |
|
Re: Simple regex question
by Your Mother (Archbishop) on Sep 15, 2010 at 16:39 UTC | |
|
Re: Simple regex question
by JavaFan (Canon) on Sep 15, 2010 at 16:23 UTC | |
by AnomalousMonk (Archbishop) on Sep 15, 2010 at 18:24 UTC | |
by JavaFan (Canon) on Sep 15, 2010 at 21:18 UTC | |
by AnomalousMonk (Archbishop) on Sep 16, 2010 at 02:05 UTC | |
|
Re: Simple regex question
by umasuresh (Hermit) on Sep 15, 2010 at 15:34 UTC | |
|
Re: Simple regex question
by planetscape (Chancellor) on Sep 15, 2010 at 20:01 UTC |