How to find a regular expression to remove all alphanumeric words from a string ?
Here is what i have tried unsuccessfully:
assume my string is: String mystring ="the food was thrill4 not2 that good 6son";
mystring = mystring.replaceAll("[0-9A-Za-z]","");
but its not working.
The expected results should be: "the food was that good"
Try this:
\w*\d+\w*\s*
Details:
\w* - starting with 0 or more word chars\d+ - one or more digit\w* - ends with 0 or more word chars\s* - match zero or more spaces after the wordIf 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