Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
Sorry for the beginner's question, but I'm a beginner :)
I'm trying to match filenames (read out of a directory by readdir). I want to match anything starting with test, having one more more digits after it, zero or more characters, but not ending in a ~.
What I have so far is:
Which covers everything except forcing it not to match if there is a ~ at the end.if ( /^test\d+/.*/ ) {print "$_\n";)
I seek enlightenment.
20040501 Edit by jdporter: Changed title from 'regex question'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: matching file names using regex
by eric256 (Parson) on Apr 29, 2004 at 18:15 UTC | |
by halley (Prior) on Apr 29, 2004 at 18:43 UTC | |
|
Re: matching file names using regex
by Enlil (Parson) on Apr 29, 2004 at 18:42 UTC | |
by halley (Prior) on Apr 29, 2004 at 18:47 UTC | |
|
Re: matching file names using regex
by pizza_milkshake (Monk) on Apr 29, 2004 at 17:59 UTC | |
|
Re: matching file names using regex
by Abigail-II (Bishop) on Apr 29, 2004 at 21:09 UTC | |
|
Re: matching file names using regex
by Eimi Metamorphoumai (Deacon) on Apr 29, 2004 at 20:44 UTC | |
|
Re: matching file names using regex
by hv (Prior) on Apr 30, 2004 at 02:03 UTC | |
|
Re: matching file names using regex
by Wassercrats (Initiate) on Apr 30, 2004 at 01:29 UTC |