|laziness, impatience, and hubris|
How can I use printf FORMAT strings for (Win32) shell globs?by ozboomer (Pilgrim)
|on Jul 17, 2017 at 01:10 UTC||Need Help??|
ozboomer has asked for the
wisdom of the Perl Monks concerning the following question:
Hi, again, folks...
I'm trying to work-out a simple/reliable regex to deal with printf 'format' strings with shell globs.
I've experimented a lot and had a look on-line... I've gone though the O'Reilly books (Perl & Regular Expression books, cookbooks, etc) and although they mention glob2pat sub (Perl Cookbook, Sect 6.9), that converts the wrong way (but see Bug in glob2pat?)... and I can't work out an 'elegant' regex to do the job I need to do.
Although... the following works Ok... but it appears pretty long-winded and ugly to me... and I'm guessing there must be a cleaner way to do it...
In this case, I'm looking at running ActiveState Perl 5.16.3 under Win32, although I'll probably also need it to work under a similar Perl version on Linux as well.
I'd greatly appreciate any guidance, please.
Thanks a heap.