Created
August 11, 2022 19:49
-
-
Save rmirabelli/1cb5063f6fe6e21f00678ee61da29c63 to your computer and use it in GitHub Desktop.
Example one: Typical regex syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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