Method RegEx():setExtended() Foundation

Sets extended mode for readable patterns.

Syntax
:setExtended( [<lExtended>] ) --> self
Parameters
<lExtended>
Set to .T. (true) to enable extended mode. A value of .F. (false) disables the feature. Defaults to .T.
Return

This method returns self.

Description

In extended mode, whitespace in the pattern is ignored (except in character classes), and # starts a comment that extends to the next newline. This allows for more readable complex patterns.

Set extended mode

oRegEx := RegEx():create("  \d{3}  # area code " + Chr(10) + ; 
"- \d{3}  # prefix    " + Chr(10) + ; 
"- \d{4}  # number    "):setExtended() 
// Use oRegEx 
oRegEx:destroy() 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.