in reply to Need help with tricky regex creation

If i understand this correctly, you wanna turn Bluff Park into ~bluff_park? and then get all the files beginning with ~bluff_park?

For the first part, use perlfunc:lc, use y/// and other goodies from perlop (like qw or q).

If you want it all in one regex, lookup what .* is, and look into the /e modifier in perlre.

For the 2nd part, use File::Find, or file globbing, or look into perlfunc:grep and what ^ and $ mean in a regex
 

Look ma', I'm on CPAN.


** The Third rule of perl club is a statement of fact: pod is sexy.
  • Comment on (podmaster) Re: Need help with tricky regex creation