In IRB, I can do this:
c = /(\b\w+\b)\W*(\b\w+\b)\W*(\b\w+\b)\W*/.match(" !!one** *two* @@three@@ ")
And get this:
=> MatchData "one** *two* @@three@@ " 1:"one" 2:"two" 3:"three"
But assuming I don't know the number of words in advance, how can I still extract all words out of the string". For example, it might be " !!one** *two* @@three@@ " in one instance, but might be " !!five** *six* " in another instance.
Thanks.