Say if I have a set of words:
211x
122x
213x
asdsax
asdsbx
ascssx
assddx
I would like to only delete the letter x from the word if it is followed before by a number. but, I do not want to delete the numbers, nor do I want to delete the x if it is followed before by a letter.
My plan is preg_replace('/[0-9]*x/' ,'',$string) but it does not seem to work.