Difference between revisions of "RegEx packages"

From Lazarus wiki
Jump to navigationJump to search
Line 1: Line 1:
 
{{Regexpr}}
 
{{Regexpr}}
  
Regexpr is a very basic regex (Regular Expression) unit. The use of regex is to search patterns inside a string.
+
Regexpr is a very basic regex (Regular Expression) unit, it handles most regular expressions as GNU regexpr. The use of regex is to search patterns inside a string.
  
 
The current unit is far from complete, and still misses very simple syntax support of [http://www.opengroup.org/onlinepubs/007908799/xbd/re.html POSIX] or more complex syntax such as [http://www.pcre.org/ Perl regex], [http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html Java Regex], [http://www.jpsoft.com/help/index.htm?regularexpressionsyntax.htm Ruby Regex] etc...
 
The current unit is far from complete, and still misses very simple syntax support of [http://www.opengroup.org/onlinepubs/007908799/xbd/re.html POSIX] or more complex syntax such as [http://www.pcre.org/ Perl regex], [http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html Java Regex], [http://www.jpsoft.com/help/index.htm?regularexpressionsyntax.htm Ruby Regex] etc...
Line 10: Line 10:
 
* DestroyRegExprEngine – Free the compilation of the pattern
 
* DestroyRegExprEngine – Free the compilation of the pattern
 
* RegExprEscapeStr – Escape reserve syntax of regular expression language so it will be understood as string instead of regex syntax.
 
* RegExprEscapeStr – Escape reserve syntax of regular expression language so it will be understood as string instead of regex syntax.
 +
 +
There is also one test:
 +
* The '''testreg1''' test program demonstrates the supported regular expressions.
 +
 +
Go to back [[Package_List|Packages List]]

Revision as of 15:55, 16 February 2009

Template:Regexpr

Regexpr is a very basic regex (Regular Expression) unit, it handles most regular expressions as GNU regexpr. The use of regex is to search patterns inside a string.

The current unit is far from complete, and still misses very simple syntax support of POSIX or more complex syntax such as Perl regex, Java Regex, Ruby Regex etc...

The unit contains 4 functions for now:

  • GenerateRegExprEngine – This function compiles the regex pattern.
  • RegExprPos – Finds the pattern inside a given string.
  • DestroyRegExprEngine – Free the compilation of the pattern
  • RegExprEscapeStr – Escape reserve syntax of regular expression language so it will be understood as string instead of regex syntax.

There is also one test:

  • The testreg1 test program demonstrates the supported regular expressions.

Go to back Packages List