Hello all,
RegEx Expressions honestly escape me. I have tried to learn to use them but for some reason the logic to use them doesn't hit home...yet.
I am trying to create a RegEx Expression that will remove trailing zeros.
I have example values like:
AJVC000
AJVC600
AJVC610
AJVC650
What I want are:
AJVC
AJVC6
AJVC61
AJVC65
There are some exceptions like:
AJVC601
In this case I do not want to remove any characters.
Any ideas or suggestions on how to learn to write these expresssions and what do I need to solve my current situation?
Thank you,
Scott
Luke,
I agree that I could do that but if I wanted to use a RegEx expression how would you do that?
TrimRight
TrimRight(String, y): Removes character in the string (y) from the end of the string (String). Y is optional and defaults to trimming white space.
TrimRight("John Smith ") returns "John Smith".
TrimRight("John Smith**","*")returns "John Smith".
Cheers,
mark
I agree that I could do that but if I wanted to use a RegEx expression how would you do that?
Hi @ScottC1971
Here's one expression that works, but would still strongly recommend the string function. Regex is not as efficient from a computational standpoint.
Regex_Replace([Field1],'([A-Z][1-9]+?|[A-Z])0+\>','$1')