jamie-purchase
02/05/2018, 1:59 PMprintln("Hello \$name".contains(Regex("[a-zA-Z0-9]+"))) // true
println("Hello \$name".contains(Regex("\$[a-zA-Z0-9]+"))) // false
have to escape the dollar in the string literal or Kotlin will treat it as a reference
and have to escape the dollar in the pattern or that means end of stringspand
02/05/2018, 2:04 PM\\$
or [$]
instead of \$
?jamie-purchase
02/05/2018, 2:07 PMnkiesel
02/08/2018, 7:05 AMRegex("""\$\w+""")
because you don't have to double the \
in raw string lterals