Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Regex: If not beginning of string match end

by Kenosis (Priest)
on Jan 17, 2013 at 20:19 UTC ( #1013881=note: print w/ replies, xml ) Need Help??


in reply to Regex: If not beginning of string match end

...I want to match the last 2 characters of any string (if numeric) that doesn't look like this:...

And here is your "this" explained that you don't want the last two characters to match:

/^[s][0|6]00[0-9]{2}/ ^ Start of string Char class [s] matches one of the following chars: s Char class [0|6] matches one of the following chars: 0|6 00 Literal `00` Char class [0-9] 2 times matches one of the following chars: 0-9

Your regex matches (or doesn't match) much more than the last two characters of any string. 2teez already mentioned your data, and it would be helpful if you would show a sample along with what you'd like to exclude from it via a regex.


Comment on Re: Regex: If not beginning of string match end
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (13)
As of 2015-07-03 13:50 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 (53 votes), past polls