Regular Expression
1. ([a-z]+) this expression will count a word from small a to small z. Such as according to this code which is given below.
<?php
$preg = "aAAAA Bbbbb bbbbb bbbbbb";
echo preg_replace("([a-z]+)", "1", $preg);
?>
You will get this output '1AAAA B1 1 1'.
2. ([a-z]) this expression will count a single character from small a to small z. Such as according to this code which is given below.
<?php
$preg = "aAAAA Bbbbb bbbbb bbbbbb";
echo preg_replace("([a-z])", "1", $preg);
?>
You will get this output '1AAAA B1111 11111 111111'.
<?php
$preg = "aAAAA Bbbbb bbbbb bbbbbb";
echo preg_replace("([a-z]+)", "1", $preg);
?>
You will get this output '1AAAA B1 1 1'.
2. ([a-z]) this expression will count a single character from small a to small z. Such as according to this code which is given below.
<?php
$preg = "aAAAA Bbbbb bbbbb bbbbbb";
echo preg_replace("([a-z])", "1", $preg);
?>
You will get this output '1AAAA B1111 11111 111111'.
Comments
Post a Comment