Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: What does it mean Nested quantifiers in regex

by anakin30 (Acolyte)
on Aug 24, 2010 at 07:05 UTC ( #856868=note: print w/ replies, xml ) Need Help??


in reply to Re: What does it mean Nested quantifiers in regex
in thread What does it mean Nested quantifiers in regex

So if i changed the (m/^de.e++ ) plus sign to \+\+ it can work is it?


Comment on Re^2: What does it mean Nested quantifiers in regex
Re^3: What does it mean Nested quantifiers in regex
by jethro (Monsignor) on Aug 24, 2010 at 10:02 UTC
    Yes, but it depends on what you want to parse with that regex. If you want to parse exactly the string "de.c++issues", then you need the regex de\.c\+\+issues. Note that I also escaped the '.' as that is a special char in regexes as well. (Escaping is the method of removing the specialness of special characters by putting a '\' in front of them)

    Or as salva propossed, you could write \Qde.c++issues\E, that would automatically escape all special characters between \Q and \E. This is probably the better way as you don't seem to know much abouts regexes and there are a lot more special characters

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (15)
As of 2014-08-22 16:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (160 votes), past polls