x89a10
x89a10

Reputation: 691

How to do diacritic insensitive matching with NSRegularExpression?

Is it possible to perform diacritic insensitive matching using NSRegularExpression? The options for regularExpressionWithPattern doesn't seem to provide this.

Upvotes: 1

Views: 445

Answers (1)

Jack
Jack

Reputation: 133619

You could remove the diacritics and work on the cleaned string, something like:

tmpString = [[[NSString alloc] initWithData:[realString dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES] encoding:NSASCIIStringEncoding] autorelease];

Upvotes: 2

Related Questions