I have an array of Strings in Java like :
["stringWithNoSuffix", "secondString", "stringWithSuffix01", "stringWithSuffix99", "stringWithSuffix8notCounted"]
I want to get all the strings in my array that end with "WithSuffix" and a number.
E.g: WithSuffix1, WithSuffix22, WithSuffix09, ... etc
My output then should be :
["stringWithSuffix01", "stringWithSuffix99"]
The String "stringWithSuffix8notCounted" is not counted because it does not end with "WithSuffix" and a number.
I can do this with .contains() or .endsWith() and some conditions but I want to use a regex if possible.
I am pretty newbie with Regular Expressions so that's the reason why I am here asking.