forked from swiftlang/swift
- Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregex.swift
23 lines (17 loc) · 573 Bytes
/
regex.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// RUN: %target-typecheck-verify-swift -enable-bare-slash-regex -disable-availability-checking
// REQUIRES: swift_swift_parser
_ =/abc/
_ =#/abc/#
_ = ##/abc/##
func foo<T>(_ x:T...){}
foo(/abc/,#/abc/#, ##/abc/##)
letarr=[/abc/,#/abc/#, ##/abc/##]
_ =/\w+/.self
_ =#/\w+/#.self
_ = ##/\w+/##.self
_ =/#\/\#\\/
_ =#/#/\/\#\\/#
_ = ##/#|\|\#\\/##
_ =(#/[*/#, #/+]/#, #/.]/#)
// expected-error@-1:16 {{cannot parse regular expression: quantifier '+' must appear after expression}}
// expected-error@-2:10 {{cannot parse regular expression: expected ']'}}