title: How to use "\w+" to find words in a string?
body: <p>I need to write a function that takes a string as input. This function will return a List[String]. I have to use the regular expression "\w+" in this function as a requirement for this task. So when given a line string of random text with a few actual words dotted around inside it, I need to add all of these 'proper' words and add them to the list to be returned. I must also use ".findAllIn". I have tried the following </p>
  
  <pre><code>def foo(stringIn: String) : List[String] = {
      val regEx = """\w+""".r
      val match = regEx.findAllIn(s).toList
      match
  }
  </code></pre>
  
  <p>But it just returns the string that I pass into the function. </p>