Skip to content

Instantly share code, notes, and snippets.

@rmirabelli
Created August 11, 2022 19:49
Show Gist options
  • Save rmirabelli/1cb5063f6fe6e21f00678ee61da29c63 to your computer and use it in GitHub Desktop.
Save rmirabelli/1cb5063f6fe6e21f00678ee61da29c63 to your computer and use it in GitHub Desktop.
Example one: Typical regex syntax
let baseString = "An anchor or an anchorman, take your pick"
let regex = try Regex("a(.*) ")
let match = baseString.firstMatch(of: regex)
print(match?.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment