Skip to content

Instantly share code, notes, and snippets.

@rmirabelli
Created August 11, 2022 19:51
Show Gist options
  • Save rmirabelli/567f1eeeee245cd252c37085a9523a8f to your computer and use it in GitHub Desktop.
Save rmirabelli/567f1eeeee245cd252c37085a9523a8f to your computer and use it in GitHub Desktop.
A simple regex using compile-time checking
let regex2 = /a(?<remainder>.*?)\ /
let match2 = baseString.firstMatch(of: regex2)
print(match2?.remainder)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment