Regular expressions: Difference between revisions

Content added Content deleted
Line 725: Line 725:
}</lang>
}</lang>
Unfortunately this method cannot find the location of the match or do substitution.
Unfortunately this method cannot find the location of the match or do substitution.

===NSRegularExpressionSearch===
{{works with|iOS|3.2+}}
Test
<lang objc>NSString *str = @"I am a string";
if ([str rangeOfString:@"string$" options:NSRegularExpressionSearch].location != NSNotFound) {
NSLog(@"Ends with 'string'");
}</lang>


===NSRegularExpression===
===NSRegularExpression===