You are here: Just a quick regular expression question! « PHP Programming Language « IT news, forums, messages
Just a quick regular expression question!

Posted by gene.ellis on 12/08/05 20:08

Hello everyone,

This should be extremely simple for youregular expression gurus out
there. I am looking for a regular expression that will look for the
hyperlinks within a string, and then add some simple code before the
hyperlinks, but only if they do not match a certain URL. For example.

$string ="This is a <a href='http://www.ur1.com'>Hyperlink</a> and this
is a <a href='http://www.ur2.com'> Hyperlink</a>";

I would like to a regular expression to look in the string for
hyperlinks that start with "http://www.ur1" and change add some code to
it like so that the string is modified like:

$string ="This is a <a
href=javascript:'http://www.ur1.com'>Hyperlink</a> and this is a <a
href='http://www.ur2.com'> Hyperlink</a>";

That's it. Thank you very much for your help!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация