I am using javascript regex to add a html markup for all the urls found like:
var exp = /(((|www\.|(http|https|ftp|news|file)+\:\/\/)[_.a-z0-9-]+\.[a-z0-9\/_:@=.+?,##%&~-]*[^.|\'|\# |!|\(|?|,| |>|<|;|\)]))/ig;
popupText = popupText.replace(exp , "<font color='red'>"+"<b>$&</b>"+"</font>" );
Now the problem is i want to make sure that it will word if the url found length is greater than 20 characters
See $& gets the match string i need to add a filter/check to gets its length.
Any help is appreciated
Use the functional form of replace: