IOS-RegexKitLite import error, ios-regexkitlite
What is RegexKitLite?
RegexKitLite is a third-party class library that easily processes regular expressions.
There is only one RegexKitLite. h and RegexKitLite. m.
What error may occur when you import RegexKitLite?
In the case of arc direct import, 20 errors will be reported. The error is as follows:
We need to find the RegexKitLite. m file under Build Phases and set it to-fno-objc-arc to solve the 20 errors.
For example:
There is also an error, such:
Solution:
Find Other Linker Flags in the compilation settings of the project, and double-click the blank field to add "-licucore.
For example:
How to Use RegexKitLite?
Scenario 1: extract a substring that complies with the regular expression from a character transmission.
Now let's assume that the id = XXXXXXXX in the following string is extracted.
1 NSString *str1 = @"http://h5.m.taobao.com/awp/core/detail.htm?id=527539084651&ali_trackid=2:mm_112790547_13020914_51016796:1457951254_264_127060785&pvid=50_124.90.181.28_427_1457951214964&e=WybQvfUPKUpw4vFB6t2Z2ueEDrYVVa64LKpWJ-in0XJRAdhuF14FMeS3otDffgY_J1gyddu7kN9gFrpfAfQEfI1vq2orw8pUjrDrPJpGNddU1KzySiK2r0EdWLwsh8FTT-iWs8bZ2Y7C0kf_oMAuHMXyFn1X9GbY40_B2z3Il4fr7hthXoIw_RgPirNhABK1UveWd6VbhEwwPrn00QwN2w&type=2&tkFlag=0";2 NSString *regex = @"id=\\d{12}";3 NSString *subStr = [str1 stringByMatching:regex];4