I'm trying create a regular expression for string comparison.
The regular expression is: .*\bword.*
However, I want to ignore special characters and the comparison should work with and without them.
For example:
O'Reilly should match O'Reilly and oreilly
It is possible do it with a regular expression?
P.S.
This is to be used in iOS with NSPredicate. Currently, the predicate looks like:
NSString *regexString = [NSString stringWithFormat:@".*\b%@.*", word];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K matches[cd] %@", keypath, regexString];
Since NSPredicate doesn't allow me to do any operation like replace the value of the keypath to a value without special characters, I need to do it via regular expression.