Home / Programming /
Labelled match
let fooRegex = /foo="(?<fooValue>.*)"/
let string = """
foo="bar"
"""
let match = string.matches(of: fooRegex).first!
print("match: \(match.output.fooValue)") // prints 'bar'
this document last modified: April 25 2024 16:38
Home / Programming /