Hi Nico,
On 29 Jan 2004 at 17:52, [EMAIL PROTECTED] wrote:
> I want to locate patterns such as
>
> 12345678
> 1 23 45 67 89
> 1 2 34 567 890
>
> and replace the pattern string with a new string.
>
> I tried
>
> $filter['message'] = eregi_replace("[0-9\s]{4,}",'',
> $filter['message']);
Use
Hi,
the "off the top of your head" was perfect. It is contrary to everything I've read on
this, but it did the trick.
>off the top of my head, I don't think '\s' is valid in a character
>class, so just use ' ' instead
>try eregi_replace("[0-9 ]{4,}"
>-Craig
Thanks
Nico
--
PHP General Mai
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: January 29, 2004 8:53 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] eregi_replace help needed
>
>
> Hi,
>
> I want to locate patterns such as
>
> 12345678
> 1 23 45
Hi,
I want to locate patterns such as
12345678
1 23 45 67 89
1 2 34 567 890
and replace the pattern string with a new string.
I tried
$filter['message'] = eregi_replace("[0-9\s]{4,}",'',
$filter['message']);
but it does not work on all the above examples.
Thanks for the assistance!
Nico
-
4 matches
Mail list logo