> >

Re: PHP regular expression summary

time:10-10-21 forum:PHP tools and code
  5. all symbols explain the



character description
\ to mark the next character as a special character, or a literal character, or a backward reference, or a octal escape character. For example,'n'matches the character "n". '\n'matches a newline. The sequence "/" matches "", while "" (") matches" ".
> matches the starting position of the input string. If you set the Multiline property of the RegExp object, ^ also matches the position after \n'or \r'. The
$match is the end position of the input string. If the Multiline property of the RegExp object is set, $also matches the position of \n'or \r'.
* matches the preceding subexpression zero or multiple times. For example, zo* can match "Z" and "zoo". * equivalent to {0,}.
matches the preceding sub expression one or more times. For example,'zo can match "Zo" and "zoo", but can not match "Z". It's equivalent to {1,}.
matches the preceding subexpression zero or once. For example, "do (ES)?" can match "do" or "does" in "do". It is equivalent to {0,1}.
{n} n is a non negative integer. Match the determined n times. For example,'o{2}'can not match the "o'" in "Bob", but it can match the two o in "food".
{n,} n is a non negative integer. Match at least N times. For example,'o{2, "can't match" o'in "Bob", but can match all o in "Foooood". 'o{1, X 'is equivalent to' o '. 'o{0, X '' is equivalent to 'o*' '.
{n, m} m and N are non negative integers, of which n
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

prev:775 CY Yang 2.8 processor 512M memory, t... next:The price of Ji'nan floor fell to nine t...
post comments
Notice



Approved   What can you eat for 10 dollars? The...   Through a hundred years, take you to...   26 mountain parks all over Ji'nan   The young man insisted on 10 years' ...   Do you remember those "made in Ji'na...
rand   The use of PHP real multithreading   PHP reads all the same types of file...   PHP garbled problem, UTF-8 (garbled)...   PHP code instance for importing SQL ...   Php Ajax implements page turning eff...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com