Matching using

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have the followning in a file:

thesis.pdf      bundle:ORIGINAL description:Here can use write the
thesis.pdf      bundle:ORIGINAL description:Testing description area
thesis.pdf      bundle:ORIGINAL description:Testing if the description
area is ok

How can I use php's  ereg_replace to remove in each line strings after

I have loaded the file into a variable and tried this:
$content = ereg_replace("description:.*$", "", $content );

I am using php version 5.2.6.

Thanks in advance.

Re: Matching using

El 24/03/2010 11:06, ofuuzo escribió/wrote:
Quoted text here. Click to load it

With preg_replace():

$content = preg_replace('/(bundle:ORIGINAL).+$/m', '', $content);

I don't know about ereg_replace() but, why care? preg_replace() is
faster and it's not deprecated ;-)

-- - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:
-- Mi web de humor satinado:

Re: Matching using

Quoted text here. Click to load it

Thanks.  It works.

- Ofuuzo

Site Timeline