I'm having trouble getting NSRegularExpression
to match patterns on strings with wider (?) Unicode characters in them. It looks like the problem is the range parameter -- Swift counts individual Unicode characters, while Objective-C treats strings as if they're made up of UTF-16 code units.
Here is my test string and two regular expressions:
let str = "dog