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
In perl:
$var =~ s{\b(\d+)(?:st|nd|rd|th)\b}{$1};
In PHP:
$var = preg_replace('/\\b(\d+)(?:st|nd|rd|th)\\b/', '$1', $var);
In .NET:
var = Regex.Replace(@"\b(\d+)(?:st|nd|rd|th)\b", "$1");