Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013881]
[Lady_Aleena]: This evening, I thought to myself, "I would love to search Netflix for 100 randomfilms from my database to see if they have them." So I went to CPAN to see if there were a modiule which could do such a thing. There is, but GUH! ...
[Lady_Aleena]: ... Does it have to be that hard and complex to use to do a search on Netflix?
Lady_Aleena grumbles.
[Lady_Aleena]: I really need to get back into the swing of Perl. I'm forgetting things from lack of use. I don't know how behind I am too.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2017-01-21 02:34 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (180 votes). Check out past polls.