fork(7) download
  1. object Main extends App {
  2. def validateReslutions(reslutions: String): Unit = {
  3. val regex = """\((\d+-\d+[dwmhy],?)*\)"""
  4. if (!reslutions.matches(regex)) {
  5. throw new Error("no match")
  6. } else {
  7. print("matched")
  8. }
  9. }
  10. validateReslutions(reslutions = "(20-1w,100-1w)")
  11. }
Success #stdin #stdout 0.46s 54324KB
stdin
Standard input is empty
stdout
matched