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

Re: Search a match to a regex from the END of a string

by sundialsvc4 (Monsignor)
on Mar 16, 2013 at 02:46 UTC ( #1023803=note: print w/ replies, xml ) Need Help??


in reply to Search a match to a regex from the END of a string

An example of the data would help.   You can, of course, specify the “end-of-string anchor” character as part of your pattern.   Then, beyond that, consider whether the pattern should or should not be “greedy.”   (A greedy pattern always seeks the longest possible matching string.)

It would be a good idea to test your regex against a number of representative strings that you do and that you don’t expect should match, e.g. with Test::More, to make very sure that the regex you come up with does what you need it to.


Comment on Re: Search a match to a regex from the END of a string

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2014-04-21 06:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (492 votes), past polls