use strict;
my $string = "!Rita 1983! and then some text and here is !Künne 1234!
and !Kußmaul 2001!";
while ($string =~ /!(\w+)\s(\d{4})!/gi) { print "$1 and $2\n";}
# prints "Rita and 1983"
while ($string =~ /!(\C+)\s(\d{4})!/gi) { print "$1 and $2\n";}
# prints "Rita 1983! and then some text and here is !Künne 1234! and
#!Kußmaul and 2001"

Why does this not print the following:

Rita and 1983
Künne and 1234
Kußmaul and 2001

And why is the regexp greedy with \C, but not with \w?

Birgit Kellner

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to