I'm not sure whether this is what you specifically want (I guess you're trying to manually format footnote references), but try this pattern:
(plus your formatting of choice)
The above example search for a non-digit character (\D), followed by comma or period or quote, followed by any number of digits (\d+). It affects only the last part (the sequence of digits), in which you can apply a character style (recommended) or just the superscript format.
In my tests, it worked in strings like:
and ignored cases like
Maybe it still needs some tweakings to fully work as you need.
Well, you probably noticed that I misread your post and thought you were looking for a GREP pattern for the Search/Replace function, not for a GREP style.
But fortunately my pattern works in a GREP style too. Just choose your desired character style in the "Apply Style:" field and use the above GREP pattern in the "To Text:" field.
Sorry about the confusion :-)