
ericsemail
Novice
Mar 29, 2007, 9:55 AM
Post #1 of 4
(1177 views)
|
|
Help w/ matching at the end of a string.
|
Can't Post
|
|
Hi-- I've searched through this thread but my problem is kind of specific and I haven't found an example that reflects what I'm trying to do.. I have a string: "XXXXXX-x50xx" i'm trying to match the end, in this case the "xx" at the end but in general I'm trying to match the last non-numeric characters until the number. Sometimes the string may be "XXXX-x50xxXX" so in this case I'd want to match "xxXX". In other cases it may look like "XXXXXX_5X". Anyway, when I do the match, I believe it's finding it, except, it's not storing the match in $1 or $& and I can't figure out why. Maybe my regular expression is wrong? I've very new to this. Can someone please help me out? Thanks
|