xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_RegExComp()

Compiles a regular expression into a binary search pattern.

Syntax

HB_RegExComp( <cRegEx>         , ;
             [<lCaseSensitive>], ;
             [<lNewLine>]        ) --> cBinaryRegEx

Arguments

<cRegEx>
This is a character string holding a literal regular expression.
<lCaseSensitive>
This parameter defaults to .T. (true) so that the resulting compiled regular expression performs a case sensitive search. Passing .F. (false) results in a case insensitive search.
<lNewLine>
This parameter defaults to .F. (false).

Return

The function returns a character string holding <cRegEx> as a compiled binary regular expression. If <cRegEx> is not a valid regular expression, a runtime error is generated.

Description

All regular expression functions and operators can process character strings containing literal regular expressions or compiled regular expressions. A literal regular expression is compiled with HB_RegExComp() to speed up pattern matching. This is advantageous when the same regular expression is used very often in a search routine.

Note:  function HB_IsRegExString() can be used to test if a variable holds a compiled regular expression.

Info

See also:HAS, HB_AtX(), HB_IsRegExString(), HB_RegEx(), HB_RegExAll(), HB_RegExSplit(), LIKE
Category: Character functions , Regular expressions , xHarbour extensions
Source:rtl\regex.c
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe