fork(4) download
  1. import java.util.*
  2.  
  3. fun main(args: Array<String>) {
  4. val reg = Regex("""\$[0-9]*\.[0-9]{2}""")
  5. val matches = reg.findAll("Price: \$1234.56 and \$1.56")
  6. val prices = matches.map{it.groupValues[0]}.joinToString()
  7. print(prices)
  8.  
  9. }
Success #stdin #stdout 0.13s 44120KB
stdin
Standard input is empty
stdout
$1234.56, $1.56