PCRE ++ Windows Version compilation process

Source: Internet
Author: User
Tags introductions

The C ++ standard lacks good Regular Expressions and requires self-installed libraries. The popular libraries include GNU RegEx library and boost. regEx, PCRE, and Greta. There are many introductions to these libraries online. You can refer to click to open the link. I don't think there are any advantages or disadvantages in the performance comparison of these libraries. You can refer to click to open the link.


I personally choose to use a Perl-compatible "PCRE", but it is not convenient to write it for C. Fortunately, someone packages the C ++ interface, that is, PCRE ++. However, in Windows-VS-C ++ environment PCRE & PCRE ++ compilation and use, the online information is very few and trivial and does not work-, after a variety of tossing, finally, PCRE ++ is successfully used. The following describes the method:


Step 1: See click to open the link and compile the PCRE successfully.

Step 2: Download PCRE ++, create a vs Empty Project, and import the header file and CC file under libpcre ++ to the project (Note: configure the project in step 1 ). If a static library is generated, select Lib for the configuration type, which can be compiled and used. If a DLL is generated, click to open the link.

Note:

The setlocale error may be reported. Change STD: :.


Step 3: The above compilation is successful. When PCRE ++ is used, # include <PCRE ++. h>, using namespace pcrepp, and import PCRed in "link-add dependency. lib, pcrepp. lib (Optional: pcrecppd. lib, pre-processor definition pcre_static)

PS: Regular Expressions of the tr1 library are supported in vs2008 and later versions. It is based on the boost regular expression library, but is not compatible with Perl.

The C ++ standard lacks good Regular Expressions and requires self-installed libraries. The popular libraries include GNU RegEx library and boost. regEx, PCRE, and Greta. There are many introductions to these libraries online. You can refer to click to open the link. I don't think there are any advantages or disadvantages in the performance comparison of these libraries. You can refer to click to open the link.


I personally choose to use a Perl-compatible "PCRE", but it is not convenient to write it for C. Fortunately, someone packages the C ++ interface, that is, PCRE ++. However, in Windows-VS-C ++ environment PCRE & PCRE ++ compilation and use, the online information is very few and trivial and does not work-, after a variety of tossing, finally, PCRE ++ is successfully used. The following describes the method:


Step 1: See click to open the link and compile the PCRE successfully.

Step 2: Download PCRE ++, create a vs Empty Project, and import the header file and CC file under libpcre ++ to the project (Note: configure the project in step 1 ). If a static library is generated, select Lib for the configuration type, which can be compiled and used. If a DLL is generated, click to open the link.

Note:

The setlocale error may be reported. Change STD: :.


Step 3: The above compilation is successful. When PCRE ++ is used, # include <PCRE ++. h>, using namespace pcrepp, and import PCRed in "link-add dependency. lib, pcrepp. lib (Optional: pcrecppd. lib, pre-processor definition pcre_static)

PS: Regular Expressions of the tr1 library are supported in vs2008 and later versions. It is based on the boost regular expression library, but is not compatible with Perl.

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.