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

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

by sundialsvc4 (Abbot)
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?
[LanX]: it's pretty ironic if you know the character
choroba likes the movie
[choroba]: Lady_Aleena Do you really need to say "WorldBuilder" after having said "WorldBuilding"?
[LanX]: have to watch it again :)
[Lady_Aleena]: choroba, the tables in that group of modules is from the World Builder's Guidebook, so I thought it best to add the name of the book to the name of the module.
[choroba]: oh, I see
[Lady_Aleena]: There is the RolePlaying:: WorldBuilding:: WorldBuildersGuide book suite and the RolePlaying:: WorldBuilding:: HighLevelCampaigns suite.

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2017-05-24 22:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?