mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-18 12:31:22 +02:00
[CHANGE] Comment match on serial key now mentions verbatim (multiline)
This commit is contained in:
@@ -322,7 +322,7 @@ kate match { case Person("Kate", _) => "Girl"; case Person("George", _) => "Boy"
|
|||||||
|
|
||||||
// Regular expressions
|
// Regular expressions
|
||||||
val email = "(.*)@(.*)".r // Invoking r on String makes it a Regex
|
val email = "(.*)@(.*)".r // Invoking r on String makes it a Regex
|
||||||
val serialKey = """(\d{5})-(\d{5})-(\d{5})-(\d{5})""".r // Using multiline string syntax
|
val serialKey = """(\d{5})-(\d{5})-(\d{5})-(\d{5})""".r // Using verbatim (multiline) syntax
|
||||||
|
|
||||||
val matcher = (value: String) => {
|
val matcher = (value: String) => {
|
||||||
println(value match {
|
println(value match {
|
||||||
|
Reference in New Issue
Block a user