Organizational Research By

Surprising Reserch Topic

how to Regular expression Basics in php?



asked Sep 13, 2013 in PHP by ashish singh
edited Sep 12, 2013
0 votes
26 views



Related Hot Questions

1 Answer

0 votes
Regular expression Basics in php:
In this article ,i will show how to use regular expressions in php.
 
 \char escape char
 
  .            Any single character
 
 [chars]       One of following chars 
 
 [^chars]      None of following chars 
 
 text1|text2   text1 or text2 
 
 ? 0 or 1 of the preceding text
 
 * 0 or N of the preceding text  (hungry) 
 
 + 1 or N of the preceding text 
 
 Example: (.+)\.html? matches test.htm and test.html
 
 (text)  Grouping of text
 
 Example:  ^(.*)\.html foo.php?bar=$1
 
  ^    Start of line anchor
 
  $    End   of line anchor 
 
 Example: ^test(.*) matches test and test1 but not ttest
  (.*)1$ matches a1 and b1, but not test
answered Sep 13, 2013 by ashish singh
edited Sep 12, 2013

...