peasepud 0 Report post Posted November 12, 2011 Seeing as our own resident Northern Ireland residing expert cant be arsed to help me because of some self centred need to gain promotion I need help from anyone that understands these. Ive tried many a time and frankly havent got a bastard clue! I know it can be done and is fairly straight forward. I want a regex that will add a bit to the start of any link in the document ie <a href="http://www.bbc.co.uk">'>http://www.bbc.co.uk"> I want to change to <a href="http://www.toontastic.net/result.php?theurl=http://wwww.bbc.co.uk"> at the same time there could be other bits in the link eg <a href="http://www.bbc.co.uk" title="BBC" /> or the http may be missing <a href="www.bbc.co.uk"/> or any one of a dozen other valid link setups. therefore I need to find any <a tags and add in a bit between the speech mark and the next char regardless of whats shown etc Anyone? Share this post Link to post Share on other sites
Howmanheyman 877 Report post Posted November 12, 2011 I seriously worry about people who actually understand that post. Share this post Link to post Share on other sites
Ant 183 Report post Posted November 12, 2011 (?:<a.*?href=[""'](?<url>.*?)[""'].*?>)(?<name>(?><a[^<]*>(?<DEPTH>)|</a>(?<-DEPTH>)|.)+)(?(DEPTH)(?!))(?:</a>) should work for finding <A href="">WHATEVER</A> had to do a bit of checking on that and if i'm honest i think certain urls will still break it edit > blah maybe not *thinks* Share this post Link to post Share on other sites
south_cheshire_toon 0 Report post Posted November 14, 2011 I know it's not an answer - but a quick goole search gave me the following :- http://www.regular-expressions.info/examples.html http://www.pagecolumn.com/tool/all_about_html_tags.htm And each page look like it has good onward links that might help. Share this post Link to post Share on other sites