Jquery Extract URL from Text -
i need extract url text using jquery.
lets have sowhere on page following textarea code
<textarea rows="20" name="textarea" style="width:100%;"> @techreport{blabl, blabla = {}, url = {http://server.com/thepdf.pdf}, wrongurl ={http://server.com/thepdf2.pdf}, blablabla = 1998, blablablabla= {blablablablabla}} </textarea>
i need url, , url contents - not wrongurl.
update: has same structure , need extract once , has "url = {" in front of it.
how this
$(document).ready(function() { $('#click').click(function(){ var 1 = document.getelementbyid('one'); one.value.match(/url ={([^}]*)}/,""); alert( regexp.$1); }) })
or runnable demo http://jsfiddle.net/peps7/10/
oops, bit late game ammended example , jsfiddle show url
Comments
Post a Comment