I need to remove ordinals via regex, but my regex skills are quite lacking. The following locates the ordinals, but includes the digit just prior in the return value. I need
If you want to remove as well the numbers followed by ordinals you could use this one:
[0-9]+(?:st| st|nd| nd|rd| rd|th| th)
So for a given text: "The 3rd person is missing but the 2 nd and the 1st is here" you'll have this output:
"The person is missing but the and the is here"