I have the following strings where I would like to identify numbers, that can be sometimes followed by any character. For example:
Cats 10, Dogs 3?Cats 10 Dogs 3Cats 10. Dogs 3@
I should be able to find 10 and 3 in each of these strings.
I tried
s.matches("[0-9,.@!]+")) but in this case I don't catch numbers not followed by special characters.