NYCPHP Meetup

NYPHP.org

[nycphp-talk] Help with regex

Jerry Kapron nyphp at NewAgeWeb.com
Fri May 16 12:33:13 EDT 2003


"*?" is an bad combination. That's why you get the error.
Perhaps you are looking for something like "[[:space:]]?<[tT][dD][^>]*>"

Jerry

--
42.7% of all statistics are made up on the spot.


-----Original Message-----
From: Nestor Florez <nestorflorez at earthlink.net>
To: NYPHP Talk <talk at nyphp.org>
Date: Friday, May 16, 2003 12:07 PM
Subject: [nycphp-talk] Help with regex


>Hi people,
>
>I am having problems doing a regex using ereg_replace
>I am reading a file and when I find a line with  white space and <td
width=123>
>I want to remove these characters up to an including the '>'.
>This is what a typical line looks like:
>-----------------------------------------
>   <td width="49">205</td>
>   <td width="155">Asaro, Doreen</td>
>   <td width="197">G.I.S.</td>
>   <td width="42">&nbsp;</td>
>----------------------------------------------
>
>I have tried the following but it does not work
>------------------------------------------
>foreach($content as $line)
>{
> $line = ereg_replace(".*>", "", $line);
> print "$i = $line <br>";
> $i++;
>}
>------------------------------------------
>
>I also tried :
>$line = ereg_replace(".*?>", "", $line);
>To make sure that it does not remove the entire line when it finds the '>'
in  "</td>"
>but I get this error:
>*Warning*: ereg_replace() [function.ereg-replace
<http://www.php.net/function.ereg-replace>]: REG_BADRPT: in *c:\\program
files\\apache group\\apache\\htdocs\\php\\readphone.php* on line *35*
>
>Any ideas?
>
>Thanks,
>
>Nestor
>
>
>--- Unsubscribe at http://nyphp.org/list/ ---
>
>




More information about the talk mailing list