IOS-RegexKitLite import error, ios-regexkitlite

Source: Internet
Author: User

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         

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.