Re: Validate String and Remove

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Even i have not tried, but i would have used ? after .+ .
so the expression now becomes:
preg_replace( '/<META HTTP-EQUIV=. +?>/','',$variable) ;

If i am not wrong even like in Perl the expression is greedy so without ? it would mach upto the last match. 

Thanks,
 
--
Regards,
Abhishek jain



----- Original Message ----
From: Stephan Schulze <nahpeps@xxxxxx>
To: php-objects@xxxxxxxxxxxxxxx
Sent: Saturday, April 5, 2008 4:05:44 PM
Subject: Re:  Validate String and Remove

Yes of course...

Without trying it out, I think it should be something like

preg_replace( '#<META HTTP-EQUIV=. +>#','',$ variable) ;

That would replace any string in $variable that starts with:
<META HTTP-EQUIV= and have at least one char before the closing >

I would advise you to have a look at
http://php.net/ manual/en/ reference. pcre.pattern. syntax.php
and
http://php.net/ manual/en/ reference. pcre.pattern. modifiers. php

Best regards...

Raul Berina schrieb:
> 
> 
> Thanks for the help.
> 
> What about I don't know exactly the the other string behind <META 
> HTTP-EQUIV= ???????????? ????????? ??>
> 
> Is that possible in preg_replace?
> 
> Thanks
> 
> Stephan Schulze <nahpeps@gmx. de <mailto:nahpeps% 40gmx.de> > wrote: This 
> will not work because starting delimiter < and ending delimiter >
> are not the same.
> 
> Better to use:
> preg_replace( '#<META HTTP-EQUIV=" refresh" CONTENT="0;
> url=http://www.redyam. com/1.html"> #','',$variable) ;
> 
> Best regards
> 
> abhishek jain schrieb:
> >
> >
> > Hi you need to use preg_replace:
> > $variable is the variable containing the string.
> >
> > preg_replace( '<META HTTP-EQUIV=" refresh" CONTENT="0;
> > url=http://www.redyam. com/1.html"> ','',$variable) ;
> >
> > http://uk2.php. net/preg_ replace <http://uk2.php. net/preg_ replace> 
> <http://uk2.php. net/preg_ replace <http://uk2.php. net/preg_ replace>>
> 
> -- 
> 
> .. UND EIN RIESIGES SCHAF WIRD VOM HIMMEL FALLEN UND DIE WELT RETTEN!!!
> ACH IHR GLÜCKLICHEN ;-)
> 
> 
> 
> 
> LearnCareGo missions mobilization for local churches
> 
> ------------ --------- --------- ---
> You rock. That's why Blockbuster' s offering you one month of Blockbuster 
> Total Access, No Cost.
> 
> [Non-text portions of this message have been removed]
> 
> 

-- 

.. UND EIN RIESIGES SCHAF WIRD VOM HIMMEL FALLEN UND DIE WELT RETTEN!!!
ACH IHR GLÜCKLICHEN ;-)

 


      ____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux