Difference between revisions of "FindRegex"

From SCAR Divi Manual
Jump to: navigation, search
(Availability)
Line 5: Line 5:
  
 
==Availability==
 
==Availability==
SCAR Divi 3.10 > Current
+
SCAR Divi 3.10 > Current <span style="color:#FF0000">(Deprecated, use [[PregMatch]])</span>
  
 
==Description==
 
==Description==
Matches a [http://www.regular-expressions.info/ regular expression] defined by '''Pattern''' in a [[AnsiString|string]] defined by '''Subject''' and returns the matched string. The pattern is defined literally and does not allow for the use of modifiers, it is case-sensitive. It is suggested you avoid using this function if you use SCAR Divi 3.25 or higher, a replacement for this function is available there as [[PregMatch]] which is far more flexible and powerful.
+
Matches a [http://www.regular-expressions.info/ regular expression] defined by '''Pattern''' in a [[AnsiString|string]] defined by '''Subject''' and returns the matched string. The pattern is defined literally and does not allow for the use of modifiers, it is case-sensitive.
  
 
==Example==
 
==Example==

Revision as of 11:00, 3 September 2011

Definition

function FindRegex(const Subject, Pattern: AnsiString): AnsiString;

Availability

SCAR Divi 3.10 > Current (Deprecated, use PregMatch)

Description

Matches a regular expression defined by Pattern in a string defined by Subject and returns the matched string. The pattern is defined literally and does not allow for the use of modifiers, it is case-sensitive.

Example

begin
  WriteLn(FindRegex('Hello World! 123', '\d+'));
end.

Output:

123

See Also