in reply to regex to match a literal dot near end of string
Thst should work, + is just not greedy enoughsub new_filename { my ($name,$platform) = @_; $name =~ /^(.*)(\..+)$/ or die "$name is an invalid patch name"; "$1.$platform$2"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: regex to match a literal dot near end of string
by japhy (Canon) on Jul 18, 2001 at 20:39 UTC | |
by MZSanford (Curate) on Jul 18, 2001 at 20:43 UTC |