Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RegEx

Status
Not open for further replies.

Extension

Programmer
Nov 3, 2004
311
0
0
CA

Hi,

I'm looking for a Regular Expression which will convert a string in the following format: Atp3233A into 3233A
So it should only trim the alpha characters preceding the numeric characters.

With my current code, I get 3233 instead of 3233A

Code:
<cfset StringtoTrim = "Atp3233A">

<<cfset NewString = REReplaceNoCase(StringtoTrim,"[A-Z]+","","ALL")>

Thanks in advance.



 
Try:


<<cfset NewString = REReplaceNoCase(StringtoTrim,"([A-Z])+$","","ALL")>

The $ should denote the end of the expression
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top