Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Re: filtering folder path using regex.

by barbie (Deacon)
on Jul 14, 2003 at 09:14 UTC ( [id://273915]=note: print w/replies, xml ) Need Help??


in reply to Re: filtering folder path using regex.
in thread filtering folder path using regex.

\\? '\' (optional (matching the most amount possible))

Is that correct? I always understood '?' to mean exactly 0 or 1 occurances, '*' or '+' would be the most possible.

--
Barbie | Birmingham Perl Mongers | http://birmingham.pm.org/

  • Comment on Re: Re: filtering folder path using regex.

Replies are listed 'Best First'.
Re: Re: Re: filtering folder path using regex.
by PodMaster (Abbot) on Jul 14, 2003 at 09:59 UTC
    The question to ask yourself is: Is it incorrect? The answer is no.

    perlre says "? Match 1 or 0 times", which means optional (like YAPE::Regex::Explain says).

    Now, the extra "(matching the most amount possible)" comment may seem a bit misleading, but it's not wrong. Consider the re-pattern f?. It means match "f" optionally. Since "f" is fixed with, it'll always match the most amount possible. This may seem a bit silly, and may or may not be an unintended sideeffect of how YAPE::Regex::Explain works, but it's perfectly fine by me (if it is unintended, I don't think it's worth a workaround, if it's not, there is no issue).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      It all comes down to interpretation and assumption. I just prefer explanations to be clear rather than a bit jagged at the edges. Anything that is open to misinterpretation most likely will be.

      If it works for you, thats fine. But it's worth bearing in mind that anyone new to the module may get mixed messages.

      --
      Barbie | Birmingham Perl Mongers | http://birmingham.pm.org/

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://273915]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-24 01:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found