sstevens has asked for the wisdom of the Perl Monks concerning the following question:
This works fine, but I don't like it. Is there a way to say "match all non-word characters except \."?# get the file from the form and call it $file $file =~ s/(.*)\.(.*)$/$1/; $ext = $2; $file =~ s/\W//g; $file = "$fileName\.$ext";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Substitute \W but not \.
by merlyn (Sage) on Mar 12, 2008 at 20:49 UTC | |
by moritz (Cardinal) on Mar 13, 2008 at 14:53 UTC | |
by merlyn (Sage) on Mar 13, 2008 at 15:37 UTC | |
|
Re: Substitute \W but not \.
by kyle (Abbot) on Mar 12, 2008 at 20:46 UTC | |
by mr_mischief (Monsignor) on Mar 12, 2008 at 22:10 UTC | |
|
Re: Substitute \W but not \.
by locked_user sundialsvc4 (Abbot) on Mar 12, 2008 at 20:50 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |