0
NSString *[email protected]"AA.BB Hello \nCC.JJ Say \nBB.CC Bye \nZZ.AA To";
NSRange r;
while ((r=[inputStr rangeOfString:@"(^[A-L].*)" options:NSRegularExpressionSearch]).location!=NSNotFound) {
NSString *newStr=[inputStr substringWithRange:r];
inputStr=[inputStr stringByReplacingCharactersInRange:r withString:@""];
NSLog(@"NEW str= %@",newStr);
}
Il donne: AA.BB Bonjour.Problèmes de syntaxe Regex objectif-c
Mais, je suis à la recherche de suffixe qui sont dans la gamme AL, comme ci-dessous
AA.BB
CC.JJ
BB.CC
Je remplacé par (^[A-L].\*)
(^[A-L]*$[\\s])
. Donc ça doit commencer par A-L et finir quand il trouve de l'espace. Mais cela ne produit rien.