This commit is contained in:
Richard Frith-Macdonald 2022-03-07 10:13:44 +00:00
parent 61d14215fa
commit ae72ee4593
3 changed files with 22 additions and 2 deletions

View file

@ -1019,15 +1019,22 @@ GSICUStringMatchesRegex(NSString *string, NSString *regex, NSStringCompareOption
#endif
case NSBeginsWithPredicateOperatorType:
{
NSRange range = NSMakeRange(0, [rightResult length]);
NSRange range;
NSUInteger ll = [leftResult length];
NSUInteger rl = [rightResult length];
if (rl > ll)
{
return NO;
}
range = NSMakeRange(0, rl);
return ([leftResult compare: rightResult
options: compareOptions
range: range] == NSOrderedSame ? YES : NO);
}
case NSEndsWithPredicateOperatorType:
{
NSRange range;
NSRange range;
NSUInteger ll = [leftResult length];
NSUInteger rl = [rightResult length];