Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

regular expression for links

http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+
Comment

link regex

var expression = /[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}([-a-zA-Z0-9()@:%_+.~#?&//=]*)?/gi;
var regex = new RegExp(expression);
var t = 'www.google.com';

if (t.match(regex)) {
  alert("Successful match");
} else {
  alert("No match");
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: js set class 
Javascript :: node js for loop 
Javascript :: oncheck event jquery 
Javascript :: get header height jquery 
Javascript :: beautify json python 
Javascript :: javascript remove focus from button 
Javascript :: jquery set checkbox checked unchecked 
Javascript :: convert text filed to password field in jquery 
Javascript :: javascript location href target _blank 
Javascript :: js for each character in string 
Javascript :: jquery if class exists 
Javascript :: disable input field from jquery 
Javascript :: discord.js get user by id 
Javascript :: js get number of keys in object 
Javascript :: remove curly brackets from stringify javascript 
Javascript :: javascript round decimal 2 digits 
Javascript :: cypress clear session storage 
Javascript :: jquery continue each loop 
Javascript :: save on focus lost sublime 
Javascript :: ansi encoding "vscode" 
Javascript :: span vertical align 
Javascript :: internal/modules/cjs/loader.js:905 throw err; 
Javascript :: get id in jquery 
Javascript :: npm ERR! code ELIFECYCLE npm ERR! errno 2 
Javascript :: remove last character from string js 
Javascript :: chart js no points 
Javascript :: document.addEventListener("load", function () { 
Javascript :: primera letra en mayuscula javascript 
Javascript :: js change video src 
Javascript :: javascript get 7 days from now 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =