perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: Getting a / when regex should produce nothing
Date Sun, 25 Apr 2010 13:57:46 GMT
Chris Bennett wrote:
...

 > $article_file = $q->param("articlefilename") || '';

ok, so suppose it is "12345.html.en"
...

> if ($article_file =~ /^([a-zA-Z0-9_-]+\.html.?\w?\w?)$/) {
>     $article_file = $1;
> } else {
>     $article_file = '';
> }

ok, matches, so it's still "12345.html.en"

> $article_backup_file = $article_file;

still "12345.html.en"

> $article_backup_file =~ s/\.html$/_backup.html/;
> 

still "12345.html.en"
(because \.html$ did not match)



Mime
View raw message