Delphi Regular expression start-up

Source: Internet
Author: User

The Delphi regular expression starts in Delphi uses the regular expression, at present Perlregex should be the first choice, prepares thoroughly and meticulously to study it.


Official website: http://www.regular-expressions.info/delphi.html
Direct download: Http://www.regular-expressions.info/download/TPerlRegEx.zip


Installation method:

1, first to unpack the Tperlregex folder put a suitable place, I placed in the Delphi Imports directory.

2, the current version of the latest for Win32 is the Delphi 2006, 2007 can also be used.
Open PERLREGEXD2006.DPK, prompt missing resource file, it doesn't matter;
Right-click on the PERLREGEXD2006.BPL in the Project Manager window to execute the Install;
At this point in the Tool Palette list already has the Tperlregex, in the Jgsoft group.

3. Environment options, Tools, Options, Delphi options, Library-win32, Library Path,
Add Path: ... \imports\tperlregex

4, can be used! Either directly uses Perlregex or add from Tool Palette.
If you don't like the way Tool Palette is added, you can omit the second step.


Planned learning steps: 1, regular grammar; 2, Tperlregex function.


//test First:usesPerlregex;//uses Regular Expression UnitprocedureTform1.formcreate (Sender:tobject);varReg:tperlregex;//Declare regular expression variablesbeginReg: = Tperlregex.create (Nil);//EstablishedReg. Subject: =' SSsS ';//This is the source string to replaceReg. RegEx: =' s ';//This is an expression, here is the substring ready to be replacedReg. Replacement: ="';//To replace with a new stringReg. ReplaceAll;//Perform all substitutionsShowMessage (Reg. Subject);//Return replacement result: s SFreeandnil (REG);//or Reg. FreeEnd;

Delphi Regular expression start-up

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.