Scala: How do I perform pattern matching on strings and regular expressions in a match expression?
Briefly

All of those expressions work, including the EmailPattern, which has the Regex type.
A cool thing about this solution is that the three regex pattern groups in the Regex pattern can be used just like constructor parameters.
Read at Alvinalexander
[
add
]
[
|
|
]