public class RegexpModule extends AbstractQuercusModule
Modifier and Type | Field and Description |
---|---|
static int |
PCRE_UTF8 |
static java.lang.String |
PCRE_VERSION |
static int |
PREG_BACKTRACK_LIMIT_ERROR |
static int |
PREG_BAD_UTF8_ERROR |
static int |
PREG_BAD_UTF8_OFFSET_ERROR |
static int |
PREG_GREP_INVERT |
static int |
PREG_INTERNAL_ERROR |
static int |
PREG_NO_ERROR |
static int |
PREG_OFFSET_CAPTURE |
static int |
PREG_PATTERN_ORDER |
static boolean[] |
PREG_QUOTE |
static int |
PREG_RECURSION_LIMIT_ERROR |
static int |
PREG_REPLACE_EVAL |
static int |
PREG_SET_ORDER |
static int |
PREG_SPLIT_DELIM_CAPTURE |
static int |
PREG_SPLIT_NO_EMPTY |
static int |
PREG_SPLIT_OFFSET_CAPTURE |
PHP_INI_ALL, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_USER
Constructor and Description |
---|
RegexpModule() |
Modifier and Type | Method and Description |
---|---|
static Regexp |
compileRegexp(StringValue regexpValue) |
static Ereg |
createEreg(Env env,
Value value) |
static Ereg |
createEreg(Value value) |
static Eregi |
createEregi(Env env,
Value value) |
static Eregi |
createEregi(Value value) |
static Regexp |
createRegexp(StringValue regexpValue) |
static Regexp[] |
createRegexpArray(Value pattern) |
static UnicodeEreg |
createUnicodeEreg(Env env,
StringValue pattern) |
static UnicodeEreg |
createUnicodeEreg(Env env,
StringValue pattern,
java.lang.String encoding) |
static UnicodeEregi |
createUnicodeEregi(Env env,
StringValue pattern) |
static UnicodeEregi |
createUnicodeEregi(Env env,
StringValue pattern,
java.lang.String encoding) |
static Value |
ereg_replace(Env env,
Value regexpValue,
Value replacement,
StringValue subject)
Replaces values using regexps
|
static Value |
ereg(Env env,
Ereg regexp,
StringValue string,
Value regsV)
Returns the index of the first match.
|
static Value |
eregi_replace(Env env,
Value regexpValue,
Value replacement,
StringValue subject)
Replaces values using regexps
|
static Value |
eregi(Env env,
Eregi regexp,
StringValue string,
Value regsV)
Returns the index of the first match.
|
static Value |
eregImpl(Env env,
Ereg regexp,
StringValue string,
Value regsV)
Returns the index of the first match.
|
static Value |
eregReplaceImpl(Env env,
Ereg regexp,
Value replacement,
StringValue subject,
boolean isCaseInsensitive)
Replaces values using regexps
|
java.lang.String[] |
getLoadedExtensions()
Returns the extensions loaded by the module.
|
static int |
getRegexpCacheSize() |
static Value |
preg_grep(Env env,
Regexp regexp,
ArrayValue input,
int flag)
Returns an array of all the values that matched the given pattern if the
flag no flag is passed.
|
static Value |
preg_last_error(Env env)
Returns the last regexp error
|
static Value |
preg_match_all(Env env,
Regexp regexp,
StringValue subject,
Value matchRef,
int flags,
int offset)
Returns the number of full pattern matches or FALSE on error.
|
static Value |
preg_match(Env env,
Regexp regexp,
StringValue subject,
Value matchRef,
int flags,
int offset) |
static StringValue |
preg_quote(StringValue string,
StringValue delim)
Quotes regexp values
|
static Value |
preg_replace_callback(Env env,
Value regexpValue,
Callable fun,
Value subject,
long limit,
Value count)
Loops through subject if subject is array of strings
|
static Value |
preg_replace(Env env,
Regexp[] regexpList,
Value replacement,
Value subject,
long limit,
Value count)
Loops through subject if subject is array of strings
XXX: need to be able to take in Regexp[] for compiled code
|
static Value |
preg_split(Env env,
Regexp regexp,
StringValue string,
long limit,
int flags)
Returns array of substrings or
of arrays ([0] => substring [1] => offset) if
PREG_SPLIT_OFFSET_CAPTURE is set
|
static LongValue |
pregMatchAllPatternOrder(Env env,
RegexpState regexpState,
StringValue subject,
ArrayValue matches,
int flags,
int offset)
Returns the index of the first match.
|
static void |
setRegexpCacheSize(int size) |
static Value |
split(Env env,
Ereg regexp,
StringValue string,
long limit)
Returns an array of strings produces from splitting the passed string
around the provided pattern.
|
static Value |
spliti(Env env,
Eregi regexp,
StringValue string,
long limit)
Returns an array of strings produces from splitting the passed string
around the provided pattern.
|
static StringValue |
sql_regcase(StringValue string)
Makes a regexp for a case-insensitive match.
|
addConstant, addConstant, addConstant, getConstMap, getIniDefinitions
public static final int PREG_REPLACE_EVAL
public static final int PCRE_UTF8
public static final int PREG_PATTERN_ORDER
public static final int PREG_SET_ORDER
public static final int PREG_OFFSET_CAPTURE
public static final int PREG_SPLIT_NO_EMPTY
public static final int PREG_SPLIT_DELIM_CAPTURE
public static final int PREG_SPLIT_OFFSET_CAPTURE
public static final int PREG_GREP_INVERT
public static final int PREG_NO_ERROR
public static final int PREG_INTERNAL_ERROR
public static final int PREG_BACKTRACK_LIMIT_ERROR
public static final int PREG_RECURSION_LIMIT_ERROR
public static final int PREG_BAD_UTF8_ERROR
public static final int PREG_BAD_UTF8_OFFSET_ERROR
public static final java.lang.String PCRE_VERSION
public static final boolean[] PREG_QUOTE
public java.lang.String[] getLoadedExtensions()
AbstractQuercusModule
getLoadedExtensions
in interface QuercusModule
getLoadedExtensions
in class AbstractQuercusModule
public static int getRegexpCacheSize()
public static void setRegexpCacheSize(int size)
public static Value ereg(Env env, Ereg regexp, StringValue string, Value regsV)
env
- the calling environmentpublic static Value eregi(Env env, Eregi regexp, StringValue string, Value regsV)
env
- the calling environmentpublic static Value eregImpl(Env env, Ereg regexp, StringValue string, Value regsV)
env
- the calling environmentpublic static Regexp compileRegexp(StringValue regexpValue)
public static Regexp createRegexp(StringValue regexpValue)
public static UnicodeEreg createUnicodeEreg(Env env, StringValue pattern)
public static UnicodeEreg createUnicodeEreg(Env env, StringValue pattern, java.lang.String encoding)
public static UnicodeEregi createUnicodeEregi(Env env, StringValue pattern)
public static UnicodeEregi createUnicodeEregi(Env env, StringValue pattern, java.lang.String encoding)
public static Value preg_match(Env env, Regexp regexp, StringValue subject, Value matchRef, int flags, int offset)
public static Value preg_match_all(Env env, Regexp regexp, StringValue subject, Value matchRef, int flags, int offset)
env
- the calling environmentpublic static LongValue pregMatchAllPatternOrder(Env env, RegexpState regexpState, StringValue subject, ArrayValue matches, int flags, int offset)
env
- the calling environmentpublic static StringValue preg_quote(StringValue string, StringValue delim)
public static Value preg_replace(Env env, Regexp[] regexpList, Value replacement, Value subject, long limit, Value count)
env
- pattern
- string or arrayreplacement
- string or arraysubject
- string or arraylimit
- count
- public static Value ereg_replace(Env env, Value regexpValue, Value replacement, StringValue subject)
public static Value eregi_replace(Env env, Value regexpValue, Value replacement, StringValue subject)
public static Value eregReplaceImpl(Env env, Ereg regexp, Value replacement, StringValue subject, boolean isCaseInsensitive)
public static Value preg_replace_callback(Env env, Value regexpValue, Callable fun, Value subject, long limit, Value count)
public static Value preg_split(Env env, Regexp regexp, StringValue string, long limit, int flags)
env
- the calling environmentpublic static StringValue sql_regcase(StringValue string)
public static Value split(Env env, Ereg regexp, StringValue string, long limit)
patternString
- the patternstring
- the string to splitlimit
- if specified, the maximum number of elements in the arraypublic static Value spliti(Env env, Eregi regexp, StringValue string, long limit)
patternString
- the patternstring
- the string to splitlimit
- if specified, the maximum number of elements in the arraypublic static Value preg_grep(Env env, Regexp regexp, ArrayValue input, int flag)
patternString
- the patterninput
- the array to check the pattern againstflag
- 0 for matching and 1 for elements that do not match