I have the following reg ex pattern to validate the email address with max length of 100 characters: (?=^.{0,100}$)([A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$)
I'm struggling to convert this pattern to the Swift 5.7's Regex builder DSL syntax, I I couldn't find a clue for how to convert it the correct way, however, the option in Xcode editor: (select the string pattern -> right-click -> Refactor -> Convert to Regex Builder) is disabled for no obvious reason.
First you need to make it regex by surrounding it with
/
like:Then you can use the Xcode's refactor feature to convert it to regex builder with one click: