Re: Clarify: SEARCH AND replace between <TAG> </TAG>

From: Date: Mon, 23 Jul 2001 04:13:02 +0000
Subject: Re: Clarify: SEARCH AND replace between <TAG> </TAG>
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-59118@lists.php.net to get a copy of this message
$line = ereg_replace("<(*.)>", "", $line); that should remove the tags, and there contents ----- Original Message ----- From: Dan Krumlauf <Boz@musheen.com> To: php list <php-general@lists.php.net> Sent: Monday, July 23, 2001 4:33 PM Subject: [PHP] Clarify: SEARCH AND replace between <TAG> </TAG> > Sorry I wasn't clear. I need to search for the <TAG></TAG> combo > in an html file. Thats why I asked for a regex. So I need to > load in the html SEARCH for the tags and anything in between the tags throw out > and REPLACE with the contents of a variable and then > rewrite the file. My orginal message follows: > > > I've been trying this one for a bit and Im in a twist. > > > > I need to replace ANYTHING or even nothing between two tags > > with the contents of a variable and just havent been > > able to get the expression right for all cases. > > > > > > As an example concept follows: > > > > <TAG></TAG> > > > > Nothing between the tags variable is $varname="some junk" > > > > so after the function > > <TAG>some junk</TAG> > > > > run it again after making variable $varname="some completly different > junk" > > > > so now the tags would be > > > > <TAG>some completly different junk</TAG> > > > > and so on and so on..... > > > > One other breaker Ive had, it needs to always replace no matter whats > > between the tags, whats not between the tags or even if its 1000s of > > characters. My code kept breaking when it was alot of characters. > > > > Any funtions or even just the right regex would be appreciated > > > > Thanks > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#59118) next »