AW: [PHP] reg-ex please
Sure :) -Ursprüngliche Nachricht- Von: John Fishworld [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 27. April 2002 1:46 PM An: Red Wingate; [EMAIL PROTECTED] Betreff: Re: [PHP] reg-ex please Excellent :-))) Thanks ! Can I trouble you again with one more ! I get an url http://whatever/file.whatever (text/html/chtml) Now trying to do the following get just the http://whatever bit and go through my array and find .gif or .html or .chtml and replace the eg "pics/my.gif" with http://whatever/pics/my.gif I've only just started with this one so haven't got very far but you were so quick I thought I'd ask ! :-)) This is my start but its definately wrong ! $code[$i] = ereg_replace("^.+.gif", "$url_file\\0",$code[$i]); er...thanks ! :-)) > Woops , one to many whitespace :) > > --> > Try it like this : > $code[$i] = ereg_replace("&#([0-9]{5});" , "\\1.bing" , $code[$i] ); > > > > -Ursprüngliche Nachricht- > Von: Red Wingate [mailto:[EMAIL PROTECTED]] > Gesendet: Samstag, 27. April 2002 1:26 PM > An: [EMAIL PROTECTED] > Betreff: AW: [PHP] reg-ex please > > Try it like this : > $code[$i] = ereg_replace("&#([0-9] {5});" , "\\1.bing" , > $code[$i] ); > > -Ursprüngliche Nachricht- > Von: John Fishworld [mailto:[EMAIL PROTECTED]] > Gesendet: Samstag, 27. April 2002 1:11 PM > An: [EMAIL PROTECTED] > Betreff: [PHP] reg-ex please > > Help please from one of the reg-ex experts out there please ! > > I'm trying to find the pattern &#(5 number); > example 𑃸 > > This works > $code[$i] = ereg_replace("&#([0-9])+" , "replace\\0.bing" , $code[$i] ); > > and I get back replace 𑃸.bing > > but I also want to lose the &# and the ; > so I get back 69880.bing > > At the moment I just re search and remove the like this > $code[$i] = ereg_replace('&#','',$code[$i]); > $code[$i] = ereg_replace(';','',$code[$i]); > > but I'm sure that theortetically I can do it in one step ! > Can anyone help ! > Thanks in advance > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reg-ex please
Excellent :-))) Thanks ! Can I trouble you again with one more ! I get an url http://whatever/file.whatever (text/html/chtml) Now trying to do the following get just the http://whatever bit and go through my array and find .gif or .html or .chtml and replace the eg "pics/my.gif" with http://whatever/pics/my.gif I've only just started with this one so haven't got very far but you were so quick I thought I'd ask ! :-)) This is my start but its definately wrong ! $code[$i] = ereg_replace("^.+.gif", "$url_file\\0",$code[$i]); er...thanks ! :-)) > Woops , one to many whitespace :) > > --> > Try it like this : > $code[$i] = ereg_replace("&#([0-9]{5});" , "\\1.bing" , $code[$i] ); > > > > -Ursprüngliche Nachricht- > Von: Red Wingate [mailto:[EMAIL PROTECTED]] > Gesendet: Samstag, 27. April 2002 1:26 PM > An: [EMAIL PROTECTED] > Betreff: AW: [PHP] reg-ex please > > Try it like this : > $code[$i] = ereg_replace("&#([0-9] {5});" , "\\1.bing" , > $code[$i] ); > > -Ursprüngliche Nachricht- > Von: John Fishworld [mailto:[EMAIL PROTECTED]] > Gesendet: Samstag, 27. April 2002 1:11 PM > An: [EMAIL PROTECTED] > Betreff: [PHP] reg-ex please > > Help please from one of the reg-ex experts out there please ! > > I'm trying to find the pattern &#(5 number); > example 𑃸 > > This works > $code[$i] = ereg_replace("&#([0-9])+" , "replace\\0.bing" , $code[$i] ); > > and I get back replace 𑃸.bing > > but I also want to lose the &# and the ; > so I get back 69880.bing > > At the moment I just re search and remove the like this > $code[$i] = ereg_replace('&#','',$code[$i]); > $code[$i] = ereg_replace(';','',$code[$i]); > > but I'm sure that theortetically I can do it in one step ! > Can anyone help ! > Thanks in advance > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP] reg-ex please
Woops , one to many whitespace :) --> Try it like this : $code[$i] = ereg_replace("&#([0-9]{5});" , "\\1.bing" , $code[$i] ); -Ursprüngliche Nachricht- Von: Red Wingate [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 27. April 2002 1:26 PM An: [EMAIL PROTECTED] Betreff: AW: [PHP] reg-ex please Try it like this : $code[$i] = ereg_replace("&#([0-9] {5});" , "\\1.bing" , $code[$i] ); -Ursprüngliche Nachricht- Von: John Fishworld [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 27. April 2002 1:11 PM An: [EMAIL PROTECTED] Betreff: [PHP] reg-ex please Help please from one of the reg-ex experts out there please ! I'm trying to find the pattern &#(5 number); example 𑃸 This works $code[$i] = ereg_replace("&#([0-9])+" , "replace\\0.bing" , $code[$i] ); and I get back replace 𑃸.bing but I also want to lose the &# and the ; so I get back 69880.bing At the moment I just re search and remove the like this $code[$i] = ereg_replace('&#','',$code[$i]); $code[$i] = ereg_replace(';','',$code[$i]); but I'm sure that theortetically I can do it in one step ! Can anyone help ! Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP] reg-ex please
Try it like this : $code[$i] = ereg_replace("&#([0-9] {5});" , "\\1.bing" , $code[$i] ); -Ursprüngliche Nachricht- Von: John Fishworld [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 27. April 2002 1:11 PM An: [EMAIL PROTECTED] Betreff: [PHP] reg-ex please Help please from one of the reg-ex experts out there please ! I'm trying to find the pattern &#(5 number); example 𑃸 This works $code[$i] = ereg_replace("&#([0-9])+" , "replace\\0.bing" , $code[$i] ); and I get back replace 𑃸.bing but I also want to lose the &# and the ; so I get back 69880.bing At the moment I just re search and remove the like this $code[$i] = ereg_replace('&#','',$code[$i]); $code[$i] = ereg_replace(';','',$code[$i]); but I'm sure that theortetically I can do it in one step ! Can anyone help ! Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reg-ex please
Help please from one of the reg-ex experts out there please ! I'm trying to find the pattern (5 number); example 𑃸 This works $code[$i] = ereg_replace("([0-9])+" , "replace\\0.bing" , $code[$i] ); and I get back replace 𑃸.bing but I also want to lose the and the ; so I get back 69880.bing At the moment I just re search and remove the like this $code[$i] = ereg_replace('','',$code[$i]); $code[$i] = ereg_replace(';','',$code[$i]); but I'm sure that theortetically I can do it in one step ! Can anyone help ! Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php