Difference between revisions of "PregQuote"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function PregQuote(const Str: AnsiString): AnsiString; </source> ==Availability== SCAR Divi 3.25 > Current ==Description== Esc...")
 
 
Line 1: Line 1:
 
==Definition==
 
==Definition==
 
<source lang="scar" lines="false">
 
<source lang="scar" lines="false">
function PregQuote(const Str: AnsiString): AnsiString;
+
function PregQuote(const Str: string): string;
 
</source>
 
</source>
  
Line 8: Line 8:
  
 
==Description==
 
==Description==
Escapes all characters that are part of the regular expression syntax in a given [[AnsiString|string]] '''Str'''. The function is modeled after the [http://www.php.net/manual/en/function.preg-quote.php equivalent] which is available in PHP.
+
Escapes all characters that are part of the regular expression syntax in a given [[string]] '''Str'''. The function is modeled after the [http://www.php.net/manual/en/function.preg-quote.php equivalent] which is available in PHP.
  
 
==Example==
 
==Example==

Latest revision as of 15:22, 26 November 2012

Definition

function PregQuote(const Str: string): string;

Availability

SCAR Divi 3.25 > Current

Description

Escapes all characters that are part of the regular expression syntax in a given string Str. The function is modeled after the equivalent which is available in PHP.

Example

begin
  WriteLn(PregQuote('--[Hello World!]--'));
end.

Output:

\-\-\[Hello World\!\]\-\-

See Also