fork download
  1. object Main extends App {
  2. val string = "<h1 id=\"test\">hello</h1> <span>world</span> and <span><i>everyone</i></span>"
  3. val pattern = """(?:<[^<>]+>\s*)(\w+)""".r
  4.  
  5. pattern.findAllIn(string).matchData foreach {
  6. m => println(m.group(1))
  7. }
  8. }
Success #stdin #stdout 0.41s 322432KB
stdin
Standard input is empty
stdout
hello
world
and
everyone