Using index(), I can find out if a string contains a specified substring.
Similarly, I can use a regular expression test to find out if a string
matches a particular pattern. What I'm LOOKING FOR is a way to find out
if a string matches a particular "wild card" character sequence, as used
in glob(), etc. For example:
if (wcm($string, '/{foo,bar}.h') { ...
should match both
$string = '/etc/bar.h';
$string = '/usr/bar.h';
but not
$string = '/etc/baz.h;
I suspect that I could munge the wild card expressions into REs, but I'm
hoping someone has already done this (or developed an alternative).
Help?
-r

Signature
email: rdm@cfcl.com; phone: +1 650-873-7841
http://www.cfcl.com - Canta Forda Computer Laboratory
http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc.
Sherm Pendley - 22 May 2005 02:46 GMT
> What I'm LOOKING FOR is a way to find out
> if a string matches a particular "wild card" character sequence, as
> used
> in glob(), etc.
Have a look at Text::Glob on CPAN.
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org