Hi all,

I'm trying from much days to solve a problem with a regular expression...
I'm going to be crazy!

I've a script that must strip a string when it find the first word containing at least 4 characters; it must print the content of the string before that word, that word, a separator and the rest of the string.

I've tried with ereg whit this script ([EMAIL PROTECTED] is the separator):

ereg( '^([^ ]{4,})(.*)$', $testo, $matches);

$contents = "[EMAIL PROTECTED]";

but it is not the right script because if the strin($testo) is "the thing is" the script doesn't find nothing and doesn't print. For this example the right content of $contents must be:

$contents = "the [EMAIL PROTECTED]";

instead of nothing.
I've tried with thousand of variant of this script but without success.
have you any ideas of the right regular expression?

Thanks in advance.
Bye


Barbara

--

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to