Avatar
Avatar
Kishikawa Katsumi
@swift-5.7.3 import _StringProcessing let pattern = #"Hello, (?<world>.*)"# let regexRuntime = try Regex(pattern) let matches = "Hello, Swift".matches(of: regexRuntime) if let m = matches[0].as((Substring, world: Substring).self) { print(m.world) }
swift57 BOT 7/2/2022 3:29 AM
exit status: 1 with stderr:<stdin>:6:23: error: value of type 'Regex<AnyRegexOutput>.Match' has no dynamic member 'as' using key path from root type 'AnyRegexOutput' if let m = matches[0].as((Substring, world: Substring).self) { ~~~~~~~~~~ ^~