| Limitations of the Basic Syntax | | Print | |
Even though regular expressions are quite powerful because of the original rules, inherent limitations make their use impractical. For example, there is no regular expression that can be used to specify the concept of "any character." In addition, if you happen to have to specify a parenthesis or star as a regular expressionrather than as a special characteryou're pretty much out of luck.
As a result of these limitations, the practical implementations of regular expressions have grown to include a number of other rules:
-
The special character "^" is used to identify the beginning of the string.
-
The special character "$" is used to identify the end of the string.
-
The special character "." is used to identify the expression "any character."
-
Any nonnumeric character following the character "\" is interpreted literally (instead of being interpreted according to its regex meaning). Note that this escaping technique is relative to the regex compiler, and not to PHP itself. This means that you must ensure that an actual backslash character reaches the regex functions by escaping it as needed (that is, if you're using double quotes, you will need to input \\). Any regular expression followed by a "+" character is a regular expression composed of one or more instances of that regular expression.
-
Any regular expression followed by a "?" character is a regular expression composed of either zero or one instances of that regular expression.
This entry was posted on . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a comment. Tags: Simple PHP, Pear, Easy PHP, PHP Tutorial, PHP MySQL, XSLT, Sap Tutorial, CSS Tutorial, XSL FO Java, SQL Tutorial.Users' Comments (0) Comment an article
No comment posted






