jbailey268
Programmer
Has anyone, who is proficient in Regular Expressions, seen this one?
In a string expression that contains or may contain ordinal words like 14TH 23RD 31ST 2ND - we need to strip any/all occurences where TH, RD, ST and ND exist but only if the immediately preceeding character is a digit.
ex)
125 THUNDER AVE AND 14TH STREET.
the TH in Thunder will not be touched but the TH after 14 must be removed (and leave the 14 alone) leaving the string 125 THUNDER AVE AND 14 STREET
Someone suggested a lookbehind or lookaround construct.
I could write a user defined function with many lines of code to do this - but a Reg expression would be a better fit since I will have many iterations and Reg expressions would save time.
Any help would be greatly appreciated.
Thank you
In a string expression that contains or may contain ordinal words like 14TH 23RD 31ST 2ND - we need to strip any/all occurences where TH, RD, ST and ND exist but only if the immediately preceeding character is a digit.
ex)
125 THUNDER AVE AND 14TH STREET.
the TH in Thunder will not be touched but the TH after 14 must be removed (and leave the 14 alone) leaving the string 125 THUNDER AVE AND 14 STREET
Someone suggested a lookbehind or lookaround construct.
I could write a user defined function with many lines of code to do this - but a Reg expression would be a better fit since I will have many iterations and Reg expressions would save time.
Any help would be greatly appreciated.
Thank you