0

How do you match whole words using a regular expression? And by words, I don't mean words with just alphabets, they could be anything. Like this sentence:

The r-a-i-n i~n S@#p=ain s\t*ays m-a-i-n-l-y i<>n t;he p|lai5n.

I'm trying to match and get each word that's separated by a space (regardless of what that word may contain), by my regex seems to be picking up each and every alphabet in the string. How can I get it to match each word?

I'm trying to get a match like this:

The r-a-i-n i~n S@#p=ain s\t*ays m-a-i-n-l-y i<>n t;he p|lai5n.

jmenezes
  • 1,888
  • 6
  • 28
  • 44

0 Answers0