I have a word written in the thai language--> ความรัก
How do I use NSRegularExpression to match this word?
I tried using the exact word but it is not working.
It is not even working on sites like regex101.com
Here is my code (swift version. But Answers in either swift or obj is appreciated). The following code is in my playground file. I always get false and never true.
let labelString = "ความรัก"
let regex = try NSRegularExpression(pattern: "ความรัก", options: [])
let rangeOfFirstMatch = regex.rangeOfFirstMatchInString(labelString, options:.ReportProgress, range:NSRange(location: 0, length: labelString.characters.count))
if (!NSEqualRanges(rangeOfFirstMatch, NSRange(location: NSNotFound, length: 0))) {
print(true)
} else {
print(false)
}
If i replace the texts with the word "man" however. I always get true