Delphi Regular Expression Syntax (5): Boundary

Source: Internet
Author: User

Delphi Regular Expression Syntax (5): Boundary
//\b Word boundaries var reg:tperlregex;   begin Reg: = tperlregex.create (nil' Delphi Delphi2007 mydelphi '; Reg. RegEx  ' \bdelphi\b '//front and back border '//return: Delphi2007 mydelphi Freeandnil ( REG); End;
//\b Word boundary: Left border var reg:tperlregex;   begin Reg: = tperlregex.create (nil' Delphi Delphi2007 mydelphi '; Reg. RegEx  ' \bdelphi '///left Border '//return: Mydelphi Freeandnil (reg);  End;
//\b Word boundary: right Border var reg:tperlregex;   begin Reg: = tperlregex.create (nil' Delphi Delphi2007 mydelphi '; Reg. RegEx  ' delphi\b '//Right Border '//return: Delphi2007 My Freeandnil (reg);  End;
//\b Non-word boundary var reg:tperlregex;  begin Reg: = tperlregex.create (nil' Delphi MyDelphi2007 mydelphi '; Reg. RegEx  ' \bdelphi\b '//Now only Delphi in MyDelphi2007 belongs to the non-word boundary '//Return: Delphi My mydelphi Freeandnil (reg); End;
//^ Beginning of the line var reg:tperlregex;  begin Reg: = tperlregex.create (nil' Delphi Delphi2007 mydelphi '; Reg. RegEx  ' ^del '//Matches Del ' at the beginning of theline'//return: Phi Delphi2007 Mydelphi Freeandnil ( REG); End;
//\a also marks the beginning of the line var reg:tperlregex;  begin Reg: = tperlregex.create (nil' Delphi Delphi2007 mydelphi '; Reg. RegEx  ' \adel '//match at the beginning of the line Del'//return: Phi Delphi2007 Mydelphi Freeandnil (reg); End;
//$ line End var reg:tperlregex;   begin Reg: = tperlregex.create (nil' Delphi Delphi2007 mydelphi '; Reg. RegEx  ' phi$ '//Match phi at end ofline'//return: Delphi Delphi2007 mydel Freeandnil ( REG); End;
//\z also marks the end of the line var reg:tperlregex;  begin Reg: = tperlregex.create (nil' Delphi Delphi2007 mydelphi '; Reg. RegEx  ' phi\z '//Match phi at end ofline'//return: Delphi Delphi2007 mydel Freeandnil (reg); End; //test, \z is case-insensitive; \a

Delphi Regular Expression Syntax (5): Boundary

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.