eregreplace() and regular expressions...
| From: | Jerry Allen | Date: | Thu, 06 Jul 2000 16:40:59 +0000 |
| Subject: | eregreplace() and regular expressions... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-5238@lists.php.net to get a copy of this message | ||
Greetings,
Regular Expressions = hmmm <scratching ones head...>
I have a string that contains
"it is very important to leave all words larger than three characters"
I want only the words that contain 4 or more characters.
Can I replace them with some type of statement like
$string = ereg_replace("[^.{1}$]", "", "$string"); // 1 char word
$string = ereg_replace("[^.{2}$]", "", "$string"); // 2 char word
$string = ereg_replace("[^.{3}$]", "", "$string"); // 3 char word
Note the above returns an empty value. <scratching my head>
Thanks