Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: regex question/mystery

by blazar (Canon)
on Jan 17, 2006 at 18:40 UTC ( #523799=note: print w/replies, xml ) Need Help??


in reply to regex question/mystery

I'm not really sure if I understand what you mean. Of course if "the first half of your expression" matches, then the second one won't. Do you really need that alternation? Wouldn't you better split it in two separate regexen? Alternatively, isn't it that you really want

/^(?:$begin1|$begin2)(\d+)/

instead?

Also, you seem to be familiar with regexen so that I may well be wrong, but your use of dots is somewhat suspect, thus I dare to ask... are you aware that "." matches "any charachter"?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2020-06-01 00:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (177 votes). Check out past polls.

    Notices?