/escape\/slash/
/escape \/ slash \/ /
/hello/
/hello world/
/\w+\s+(\d+)\s+\w+/
/(.+?): (.+)/
/(?<identifier>[[:alpha:]]\w*) = (?<hex>[0-9A-F]+)/
let p = /hello/
let n = /hello/ + /world/ - /nice/
let q = /hello/ / 2
(/hello/)
method(value: /hello/)
method(/hello/, world)
method(/hello/, /world/)
foo(/a, b/)
qux(/, !/)
qux(/,/)
let g = hasSubscript[/]/2
let h = /0; let f = 1/
let i = /^x/
#/raw\/slashes/#
#/raw \/ slashes \/ /#
#/hello/#
#/he/llo/#
##/hello/##
##/he/llo/##
###/hello/###
###/he/llo/###
####/hello/####
####/he/llo/####
#/hello world/#
#/\w+\s+(\d+)\s+\w+/#
#/(.+?): (.+)/#
let p = #/hello/#
let n = #/hello/# + /world/ - #/nice/#
let q = #/hello/# / 2
(#/hello/#)
method(value: #/hello/#)
method(#/hello/#, world)
method(#/hello/#, #/world/#)
#/regex with #not a comment/#
let regex = #/
(?<kind> \w+) \s\s+
(?<date> \S+) \s\s+
(?<account> (?: (?!\s\s) . )+) \s\s+
(?<amount> .*)
/#
#/
this is another extended regex literal
/this is still in the regex/
123
12 / 2
(/hello/)
backslash escape literal newline\
newline explicit\n
nice
/#
##/
multiline
/##
###/
multiline
/###
2 / 2 / 2
2 / 2 / 2
2 /2/ 2
2 /2 / 2
2 / 2/ 2
2 #/ 2 /# 2
/\ escaped leading whitespace/
x+/y/
x + /y/
x+#/y/#
struct Planet {
var d = /test/
var e = #/test/#
var n: Any {
/test/ + #/test/#
}
}
/something
another line
/