[REBOL] How to parse a filename using wildcards
From: ale870:gma:il at: 17-Jul-2007 8:04
Hello,
I have a problem using FIND/ANY with wildcards.
The problem is I need to find some files/dir using typical wildcards (or
something similar :-) ) to filter a filename list.
I tried to use FIND/MATCH/ANY, but I found a... bug (?).
Please take a look the following code:
foreach i read %/f/mydocs/rebol/. [
f1: (find/match/any i "view*.htm")
if f1 <> none [print f1 ]
]
using the syntax << find/match/any filename "view*.htm" >> the command will
return (for example):
introduction.htm
tutorial1.htm
information.html <----- WRONG!
information.html
is not correct! Since I didn't ask << find/match/any
filename "view*.htm*" >> (see the last asterisk).
Furthermore, if I use << find/match/any filename "view*.h" >> I got the
same results!!! :-(
I think the pattern matching is not perfect.
Can you suggest me a workaround (maybe using parse? In which way?) to make a
true, fully functional filter for filename, extension?
Thank you for your help!
--
--Alessandro