The strings in the column have other digits in the middle or beginning but I only want the digits at the very end followed by an x
. For example, if the string is
23apples7892x
I want to return
7892x
I’ve tried so many ways but keep getting en error or it’ll include all the digits in the string which I don’t want
4
This might* do it:
w*d*w+(d+x)
You said digits are in the middle of beginning, so I understand this to be
abc123abc456x — in the middle
123abc456x — at the beginning
in either case, you might want to search:
word characters w (zero or many) *, zero or many digits, one or many word characters, and finally one or many digits and the x character.
*Without knowing your regex enginer or your sample data, this is a (hopefully correct) guess at what you are asking for.
As others have said, post the errors you are getting, what you have tried, and a set of data showing all possible patterns (if possible) and expect output. Then you will get accurate help.