Lex Thoonen wrote:
Hi,

I'm trying to do this:

in the original text is this:

((se-HomePage|Svenska))

I want to leave it at just:

Svenska

So I tried this:

$row[3] =~ s|\(\(.*?\|(.*?)\)\)|$1|g;

but somehow after substituting it now shows:

((se-HomePage|Svenska


I don't get it.

$ perl -le'print qr|\(\(.*?\|(.*?)\)\)|'
(?-xism:\(\(.*?|(.*?)\)\))

Your pattern says to match *either* /\(\(.*?/ *or* /(.*?)\)\)/.

Change the delimiter from | to something else:

$ perl -le'print qr/\(\(.*?\|(.*?)\)\)/'
(?-xism:\(\(.*?\|(.*?)\)\))





John
--
Those people who think they know everything are a great
annoyance to those of us who do.        -- Isaac Asimov

--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to