Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: regular expression not matching

by igelkott (Priest)
on Mar 13, 2013 at 07:46 UTC ( #1023135=note: print w/replies, xml ) Need Help??


in reply to regular expression not matching

I understand that you posted the wrong code but a small change in the original will work as (apparently) intended. Specifically, the first '+' should be moved outside the square brackets since "\w", "_", "-" are all in the set you're looking for.

In other words, change ([\w+\_\-]) to ([\w\_\-]+). Better yet, since "_" is included in "\w" and "-" doesn't need to be escaped if it's first or last, you can simplify this to ([\w-]+).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1023135]
help
Chatterbox?
[erix]: heh almshouse
[erix]: (just caught that)
[Discipulus]: it's something like soul's house, no? Alma is something Discipulus understand

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2017-11-23 20:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (337 votes). Check out past polls.

    Notices?