I’m trying to find the regular expression to find just the alphanumeric words from a string i.e the words that are a combination of alphabets or numbers. If a word is pure numbers or pure characters I need to discard it.
I’m trying to find the regular expression to find just the alphanumeric words from
Share
Try this regular expression:
Or more compact:
This matches all words (note the word boundaries
\b) that either start with one or more letters followed by one or more digits or vice versa that may be followed by one or more letters or digits. So the condition of at least one letter and at least one digit is always fulfilled.