Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Petr Vileta
February 19, 2008, 4:21 pm
rate this thread
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.
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
$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>