I have two regex patterns in Swift, both work for each case separately:
case twoWords = "(@\w+\s\w+)" = @User Name
case twoWordsWithDash = "@(\w+\s\w+\-\w+)" = @User Name-Hyphen
Question:
How can I combine these two regex patterns in their respective strings, so the regex will configure EITHER twoWords or twoWordsWithDash??
What I want:
case twoWordsORtwoWordsWithDash = "(@\w+\s\w+)|@(\w+\s\w+\-\w+)" = @User Name OR @User Name-Hyphen
But this fails, that OR operator | doesn't seem to work..