psExpression - cRegEx
Regular expression pattern used for matching, searching, or manipulating strings
Type: Property
Access: Read/Write
Data Type: String
Parameters: None
Syntax
Property String psExpression
| Access Type | Syntax |
|---|---|
| Read Access: | Get psExpression to StringVariable |
| Write Access: | Set psExpression to StringVariable/Value |
Description
The regular expression pattern used for matching, searching, or manipulating strings. This pattern is compiled and cached for efficient repeated use in operations.
Regular expressions in DataFlex follow the PCRE2 syntax. If you are new to regular expressions or need a refresher, RegEx101.com is an excellent resource.
On RegEx101.com, you can: - Experiment with your expressions interactively. - See a breakdown of the syntax and what each part of your expression does. - Learn advanced techniques like named groups, lookaheads, and backreferences.
To ensure compatibility, select PCRE2 as the syntax while testing your expressions. This matches the behavior of the cRegEx class and ensures consistent results in your application.
Sample
Set psExpression of oRegEx to "\d+" // regex for searching digits