Guest User

Untitled

a guest
Oct 24th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. function hasUrl(inputText) {
  2. var regex = /[-a-zA-Z0-9@:%_+.~#?&//=]{2,256}.[a-z]{2,4}b(/[-a-zA-Z0-9@:%_+.~#?&//=]*)?/g;
  3. var matches = 0;
  4. var match;
  5.  
  6. while ((match = regex.exec(inputText))) {
  7. return true;
  8. }
  9.  
  10. return false;
  11. }
Add Comment
Please, Sign In to add comment