Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 imbibing at the Monastery: (4)
As of 2015-07-04 00:39 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 (57 votes), past polls