Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Regex question

by Enlil (Parson)
on Aug 08, 2005 at 06:44 UTC ( #481804=note: print w/ replies, xml ) Need Help??


in reply to Regex question

The difference is that with [] is part of a character class, which means that anything (in this case a line) within the [] will constitute a match at this position. So in your code, [htm|asp] anything that contains any of the following characters will match: h t m | a s p.

On the other hand with parenthesis you are asking the regex engine to match anything with htm OR asp, and hence output.php doesn't match.

You might want to have a look at perlretut and perlre for more info.

-enlil


Comment on Re: Regex question
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2015-07-08 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (96 votes), past polls