[REBOL] Re: How to parse a filename using wildcards
From: ale870::gmail::com at: 17-Jul-2007 10:58
Oh yes, I know.
I used parenthesis just to make the code a little bit more readable even for
non expert people :-)
Regarding "none", you agree, I will eliminate it!
On 7/17/07, sqlab <sqlab-gmx.net> wrote:
>
> Hi Alessandro
>
> There is no need for the parenthesis and the double comparison
> just
>
> if find/match/any/tail i "*.jpg" [
>
> is enough
>
> Alessandro Manotti wrote:
> > 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.
> >>
> >>
> >>
> >
> >
> >
>
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
>
--
--Alessandro