This question already has an answer here:
I have a question regarding regex in Java where I have trouble to find words within a given String. Let's say we have a string looking something like this:
String string = "12*&3hello93!#48World56(5a";
Now what i want to find are the words hello, World and a. The criteria would therefore be to only find series of letters and exclude everything else.
I have tried some expressions but with no luck. The regex pattern "(\w+)" suggested here is close to what I am looking for but it includes digits which i don't want to find. Another expression I have tried is "([\\w\\s]+)" which didn't bring me any closer to a solution.
Thank you for your time.
Aucun commentaire:
Enregistrer un commentaire