We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Just an idea (untested):
struct Result: Codable { let word: String? let number: Int? } let regex = Regex(#"\d+(?<\#(.word)>[a-z]+)(?<\#(.number)>\d+)"#, type: Result.self) let groups = regex.firstMatch(in: "123unicorn456")?.namedGroups print(groups.word) //=> Optional("unicorn") print(groups.number) //=> Optional(456) // ^ Int
Feedback wanted!
The text was updated successfully, but these errors were encountered:
Regex#namedGroups
No branches or pull requests
Just an idea (untested):
Feedback wanted!
The text was updated successfully, but these errors were encountered: