objective c - about RegexKitLite linebreak -



objective c - about RegexKitLite linebreak -

i'm utilize regexkitlite match texts:

xxx*[abc]*xxx

and want match [abc],and utilize regular:

nsstring *result = [@"xxx[abc]xxx" stringbymatching:@"\\[(.*)?\\]" capture:1];

then, result [abc].but, if have linebreak in there:

xxx[ab c]xxx

it's dosen't work. utilize ([\s\s]*), dosen't math [abc]. how can match text? give thanks you

the . not match new lines default. utilize

... stringbymatching:@"(?s:\\[(.*)?\\])" ... // ^^^^ ^

or supply rkldotall alternative -stringbymatching:options:inrange:capture:error: method.

alternatively, utilize greedy variant

@"\\[([^\\]]*)\\]" // \[ ( [ ^\] ] ) \]

objective-c line-breaks regexkitlite

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -