Difference between revisions of "RegexPos"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function RegexPos(const Subject, Pattern: AnsiString): Integer; </source> ==Availability== SCAR Divi 3.10 > Current ==Descript...")
 
 
(4 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
 
==Availability==
 
==Availability==
SCAR Divi 3.10 > Current
+
SCAR Divi 3.10 > 3.34
  
 
==Description==
 
==Description==
Matches a [http://www.regular-expressions.info/ regular expression] defined by '''Pattern''' in a [[AnsiString|string]] defined by '''Subject''' and returns the position of matched string in '''Subject'''. 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 [[PregMatchEx]] 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 position of matched string in '''Subject'''. The pattern is defined literally and does not allow for the use of modifiers, it is case-sensitive.
  
 
==Example==
 
==Example==
Line 25: Line 25:
 
*[[ReplaceRegex]]
 
*[[ReplaceRegex]]
  
[[Category:Functions]]
+
[[Category:Deprecated Functions]]
[[Category:String Functions]]
 
[[Category:Regex Functions]]
 

Latest revision as of 11:11, 25 July 2012

Definition

function RegexPos(const Subject, Pattern: AnsiString): Integer;

Availability

SCAR Divi 3.10 > 3.34

Description

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

Example

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

Output:

14

See Also