PHP REGEX

Submitted by: 
We already seen the caret(^) as match the the beginning of string and (\z) match at the end of string that what they do. Now we are going to look with the others with beggining of bracket []. These Meta character are specifying a character class. What does the character class? This is a set of character that you want to match the string. They can listed individually like [abcdf] or a range [a-f...
Submitted by: 
In our last tutorials regarding ReGex we have some simple pattern of matching. We also use caret (^) For matching at the beginning of the string and (\z) to match at the end of the string. These characters are called Meta Characters and shown below. a. . (Full stop) b. ^ (Carat) c. * (Asterix) d. + (Plus) e. ? (Question Mark) f. { (Opening curly brace) g. [ (Opening brace) h. ] (Closing brace) i...
Submitted by: 
In previous tutorial we have a pattern that match a string at the beggining using caret(^). Now we try to match the pattern at the end of the string using \z. What is \z? This is end of subject or read at the end of subject. We still use (i) case insensitive modifier so that it can read any case. <?php // create a string $string = 'Ronard' ; //display the string Ronard echo "<b>String is...
Submitted by: 
In previous tutorial we match the given string. Now we are going to match at the beginning of the given string. <?php // make a string $string = 'Ronard' ; echo "<b>String: </b>" . $string . "<br>" ; // match the beginning of the string if ( preg_match ( "/^Ron/" , $string ) ) { // if it matches we display this line echo 'The string begins with Ron' ; } else { // if no match...
Submitted by: 
In this tutorial I will show you the basic in regex. In brief discussion. Regex is considered a method of matching pattern within a string. In PHP usually used PCRE or "Perl Compatible Regular Expressions". Let's see a sample to print a string. <?php // create a string $string = 'abcdefghijklmnopqrstuvwxyz0123456789' ; // echo our string echo $string ; ?> The above code are printing "...