I want to extract all words from a java String.
word can be written in any european language, and does not contain spaces, only alpha symbols.
it can contain hyphens though.
If you aren't tied to regular expressions, also have a look at BreakIterator, in particular the getWordInstance() method:
Word boundary analysis is used by search and replace functions, as well as within text editing applications that allow the user to select words with a double click. Word selection provides correct interpretation of punctuation marks within and following words. Characters that are not part of a word, such as symbols or punctuation marks, have word-breaks on both sides.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With