Online
 
Friday, 09 January 2009
 
 
More article:
Related Content:

Limitations of the Basic Syntax
 
Article Index
Limitations of the Basic Syntax
Page 2
Page 3
Page 4

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.


    Tags: Add more tags...,
    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
      Name
      E-mail
       Title
    Available characters: 4000
     Notify me of follow-up comments
    This image contains a scrambled text, it is using a combination of colors, font size, background, angle in order to disallow computer to automate reading. You will have to reproduce it to post on my homepage
    Enter what you see:

    No comment posted

Natural 45
Statistic


Last Post

 
Top! Top!