Detailed Description
Validates values using regular expressions
- Version:
- 1.0
Definition at line 27 of file Regex.php.
Member Function Documentation
Adds new regular expressions to the list
- Parameters:
-
| string | $name | Name of rule |
| string | $pattern | Regular expression pattern public |
Definition at line 75 of file Regex.php.
Returns the javascript test (the test should return true if the value is INVALID)
- Parameters:
-
| mixed | Options for the rule public |
- Returns:
- array first element is code to setup validation, second is the check itself
Reimplemented from HTML_QuickForm_Rule.
Definition at line 81 of file Regex.php.
Validates a value using a regular expression
- Parameters:
-
| string | $value | Value to be checked |
| string | $regex | Regular expression public |
- Returns:
- boolean true if value is valid
Definition at line 54 of file Regex.php.
Field Documentation
Initial value: array(
'lettersonly' => '/^[a-zA-Z]+$/',
'alphanumeric' => '/^[a-zA-Z0-9]+$/',
'numeric' => '/(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/',
'nopunctuation' => '/^[^().\/\*\^\?#!@$%+=,\"\'><~\[\]{}]+$/',
'nonzero' => '/^-?[1-9][0-9]*/'
)
Definition at line 38 of file Regex.php.
The documentation for this class was generated from the following file:
- C:/xampp/htdocs/moodle/lib/pear/HTML/QuickForm/Rule/Regex.php