Closed DivineDominion closed 7 years ago
Have been tinkering away on this. And boy did the italics regex get longer ...
let strictItalicPattern: String = [ "(^|[\\W_]) (?:(?!\\1)|(?=^))", "(\\*|_)(?:(?!\\2)|(?=\\2\\2)) (?=\\S)", // opening "(.*?(?!\\2)\\S)", // content "\\2(?:(?!\\2)|(?=\\2\\2))", // closing "(?=[\\W_]|$)" ].joined(separator: "")
For reference, here's the Regex in a debugger: https://regex101.com/r/mveS1B/2
Have been tinkering away on this. And boy did the italics regex get longer ...
For reference, here's the Regex in a debugger: https://regex101.com/r/mveS1B/2