Module cream.regex

API for perl compatible regular expression

Author:

David Delassus <david.jose.delassus@gmail.com>

Functions

Regex:match (str) Scans for a match in string for pattern
Regex:replace (str, replace) Replaces all occurrences of the pattern in regex with the replacement text
cream.regex (pattern) Create a new perl compatible regular expression


Functions

Regex:match (str)
Scans for a match in string for pattern

Parameters

  • str: String to scan

Return value:

TRUE is the string matched, FALSE otherwise
Regex:replace (str, replace)
Replaces all occurrences of the pattern in regex with the replacement text

Parameters

  • str: String to scan
  • replace: Replace all occurrences with this string

Return value:

The new string on success, nil otherwise
cream.regex (pattern)
Create a new perl compatible regular expression

Parameters

  • pattern: The regex pattern

Return value:

A new regex

Valid XHTML 1.0!