Regular expressions

import scala.util.matching.Regex

val numberPattern: Regex = "[0-9]".r

numberPattern.findFirstMatchIn("awesomepassword") match {
  case Some(_) => println("Password OK")
  case None => println("Password must contain a number")
}

Are strings which can be used to find patterns (or lack thereof) in data.

Regular expressions — Structure map

Clickable & Draggable!

Regular expressions — Related pages: