dhcrusoe Posted June 15, 2009 Share Posted June 15, 2009 Hey all, I'm working on a relatively simple regex to strip the test.mp3 (filename) from the following code: <a href="http://www.wowshowcase.org/showcase/assets/Destiny_By_Design_Spring_09a.mp3">Destiny by Design</a> with this regex: var audiofile = vRows[i].firstChild.nodeValue.replace(/<a[^href]+href=\"([^\"]*)\"[^>]*>/ig,"$1"); and the result is... Destiny_By_Design_Spring_09a.mp3Destiny by Design</a> Hmm... any suggestions? (Trying to get an embedded player working; the click-to-download thing kinda stinks!) Thanks so much! --Dave Link to comment https://forums.phpfreaks.com/topic/162277-simple-error-in-regex-stripping-url-from-anchor-tag/ Share on other sites More sharing options...
Ken2k7 Posted June 16, 2009 Share Posted June 16, 2009 Woah too complicated to comprehend. Try something simple like this - var audiofile = vRows[i].firstChild.nodeValue.match(/[^\/]+?\.mp3/); alert(audiofile); Link to comment https://forums.phpfreaks.com/topic/162277-simple-error-in-regex-stripping-url-from-anchor-tag/#findComment-856853 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.