Post

Replies

Boosts

Views

Activity

Swift 5.7 Regex failed to match Foundation URL
Code to reproduce: let inputString = "url(https://example.com)" let regex = Regex {   "url("   Capture {     .url()   }   ")" } guard let (_, url) = inputString.firstMatch(of: regex)?.output else {   fatalError() } print(url) Regex matches if we change "url(" to "(": let regex = Regex {   "("   Capture {     .url()   }   ")" } However, the output is Is this a bug?
0
0
891
Jul ’22
Swift 5.7 Regex failed to match Foundation URL
Code to reproduce: let inputString = "url(https://example.com)" let regex = Regex {   "url("   Capture {     .url()   }   ")" } guard let (_, url) = inputString.firstMatch(of: regex)?.output else {   fatalError() } print(url) Regex matches if we change "url(" to "(": let regex = Regex {   "("   Capture {     .url()   }   ")" } However, the output is Is this a bug?
Replies
0
Boosts
0
Views
891
Activity
Jul ’22