Files
swift-mirror/test/StringProcessing/Parse/regex.swift
Richard Wei 72ebcded98 Integrate newer string processing (a0ed7e1)
Friend PR: apple/swift-experimental-string-processing#282.

Also remove the `-enable-experimental-pairwise-build-block` flag when building regex modules as the feature is already on by default.
2022-04-15 12:01:45 -07:00

24 lines
566 B
Swift

// RUN: %target-typecheck-verify-swift -enable-bare-slash-regex -disable-availability-checking
// REQUIRES: swift_in_compiler
_ = /abc/
_ = #/abc/#
_ = ##/abc/##
func foo<T>(_ x: T...) {}
foo(/abc/, #/abc/#, ##/abc/##)
let arr = [/abc/, #/abc/#, ##/abc/##]
_ = /\w+/.self
_ = #/\w+/#.self
_ = ##/\w+/##.self
_ = /#\/\#\\/
_ = #/#/\/\#\\/#
_ = ##/#|\|\#\\/##
_ = (#/[*/#, #/+]/#, #/.]/#)
// expected-error@-1 {{cannot parse regular expression: quantifier '+' must appear after expression}}
// expected-error@-2 {{cannot parse regular expression: expected ']'}}