regexp for accented characters

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I have string in cp1250 codepage and I need to use regexp to extract part of
string. All is simple but I want to run the same script under Perl 5.6.1 and
5.8. And here is the problem.

Example 1
require utf8 if($] > 5.006001);
$string = "Telefón: 123456789\nFax: 123456789";
$string =~ m/Telef.n:\s+(\d+)\s+Fax:\s+(\d+)/
my ($phone,$fax) = ($1,$2);

This work for Perl 5.6.1 but fail for Perl 5.8. For Perl 5.8 I must write
regexp as

$string =~ m/Telef.+?n:\s+(\d+)\s+Fax:\s+(\d+)/

This modified regexp work for 5.6.1 too but is not clear because possible can
acept string "Telefóon..." too.
Please can anybody describe me how regexp works under Perl 5.8 and "use utf8"
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail from
another non-spammer site please.)

Please reply to <petr AT practisoft DOT cz>

Site Timeline