Hello,
What would the regular expression be to remove all the text
between ( )
$string = This is a (001 Test) and (002 Test);
The numbers always change but the word stays the same
Any help would be appreciated.
Thank You
Brian Paulson
Sr. Web Developer
[EMAIL PROTECTED]
On Wednesday, February 20, 2002, at 05:24 PM, Brian Paulson wrote:
What would the regular expression be to remove all the text
between ( )
$string = This is a (001 Test) and (002 Test);
The numbers always change but the word stays the same
preg_replace(/(\()\d{3,3} Test(\))/, \1\2,
what do you have so far ?
at least you need to 'replace', and I recommend
perl style preg_replace() which is very powerfull.
then you need an expressions that matches the
'(001 Test)' part, how to do this can be found in
the manual, however here's a small tip:
/[0-9]+/ matches a series of
:30 AM
To: Brian Paulson; php-general
Subject: Re: [PHP] Removing every thing between ( )
what do you have so far ?
at least you need to 'replace', and I recommend
perl style preg_replace() which is very powerfull.
then you need an expressions that matches the
'(001 Test)' part, how to do
every thing between ( )
whoops.. I see you allready got a cut and clean answer.
now your lazy *and* lucky ;)
try to figure it yourself next time, believe me it'll open up
possibilities!!
bvr.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net
]]
Sent: Wednesday, February 20, 2002 2:33 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Removing every thing between ( )
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
. And
no doubt there will be more in the furure...
Just me 2c worth
Martin
-Original Message-
From: Brian Paulson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 11:06 AM
To: 'bvr'; [EMAIL PROTECTED]
Subject: RE: [PHP] Removing every thing between ( )
Ok help me out here, isn't
7 matches
Mail list logo