A Scripting Language for Web, Linux and Windows

A Scripting Language for Web, Linux and Windows

Module: regex

Support regular expressions based on PCRE library. The module must be loaded with dl('regex');

Functions are compatible with theire PHP pendants.

Function/Arguments Return Description
preg_match (string pattern, string subject, [, array& matches, number flags=0]) number Find the first regular expression pattern in subject. If matches is given as reference to an array, it will be filled with the matches. If flags is 1 (PREG_OFFSET_CAPTURE) then the position of found pattern is stored in matches. Numbers of found patterns are returned. On error false is returned. See also preg_match () for detailed description.
preg_match_all (string pattern, string subject, [, array& matches, number flags=0]) number Same as preg_match but find all regular expression patterns. flags can be following and binary combined: 1 = PREG_OFFSET_CAPTURE, 2 = PREG_SET_ORDER. See also preg_match_all () for detailed description.
preg_replace (mixed pattern, mixed replacement, string subject) string Replace a regular expression pattern with replacement in subject, pattern and replacement can be arrays. The replaced subject is returned. See also preg_replace () for detailed description.

back to Home

V1 Version 0.95 - Documentation generated Sun, 02 Dec 2018 16:29