Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: How to parse a filename using wildcards

From: ale870:g:mail at: 17-Jul-2007 9:41

Wow! This refiniment will compact my code something more: foreach i read %/f/mydocs/rebol/. [ if (find/match/any/tail i "*.jpg") <> none [ print i ];if ];foreach Thank you! I will publish it in my blog as tips & tricks. On 7/17/07, sqlab <sqlab-gmx.net> wrote:
> > or shorter > > >> find/match/any/tail "somethingelse" "some*g" > == none > >> find/match/any/tail "something" "some*g" > == "something" > >> > > Gabriele Santilli wrote: > > 2007/7/17, Alessandro Manotti <ale870-gmail.com>: > > > > > >> I tried to use FIND/MATCH/ANY, but I found a... bug (?). > >> > > > > Not a bug - FIND returns the end of the match. You can use TAIL? to > > check if the whole string matched. > > > > > >>> find/match/any "something" "some*g" > >>> > > == "" > > > >>> find/match/any "somethingelse" "some*g" > >>> > > == "else" > > > >>> tail? find/match/any "something" "some*g" > >>> > > == true > > > >>> tail? find/match/any "somethingelse" "some*g" > >>> > > == false > > > > HTH, > > Gabriele. > > > > -- > To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject. >
-- --Alessandro