Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013881]
help
Chatterbox?
choroba will se in a minute...
[choroba]: *see
[LanX]: you will Theodi-see!
[Eily]: congrats choroba :)
[Discipulus]: choroba i made you Bishop !!
[choroba]: 9999 points until level 23 - Archbishop.
[LanX]: darn trying to downvote him again fails ... ;-P
[Discipulus]: congrats!
[LanX]: His Excelleny Choroba will now nbe clothed in his new robe ...
[Discipulus]: bishop ship sheeps in the shop..

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2017-09-26 11:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (294 votes). Check out past polls.

    Notices?