does regular expression in objc support balancing group? if not, there other solution fix it?
i find pattern syntax supported specified icu in apple developer , icu tells nothing balancing group.
a simple test balancing group,
(?'group'1)2(?'-group'3)(?(group)?!)
i test both in xcode search field , using nsregularexpression.
here code , error:
nserror* error; re = [nsregularexpression regularexpressionwithpattern:@"(?'group'1)2(?'-group'3)(?(group)?!)" options:nsregularexpressioncaseinsensitive error:&error]; nslog(error);
error:
error domain=nscocoaerrordomain code=2048 "the value “(?'group'1)2(?'-group'3)(?(group)?!)” invalid." userinfo=0x1003b85b0 {nsinvalidvalue=(?'group'1)2(?'-group'3)(?(group)?!)}
Comments
Post a Comment