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

regex validate link

/^(?:http(s)?://)?[w.-]+(?:.[w.-]+)+[w-._~:/?#[]@!$&'()*+,;=.]+$/gm
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 :: set multiple attributes javascript 
Javascript :: deep copy object/array 
:: test variable type javascript 
Javascript :: how to detect account change in metamask 
::  
::  
::  
::  
Javascript ::  
Javascript :: firebase.database is not a function 
Javascript :: vue property decorator emit 
Javascript :: can we find lenght of an object 
Javascript ::  
:: package.json tilde vs caret 
Javascript :: get number from range line js 
Javascript :: loop through map in js 
Javascript :: javascript change div order 
Javascript :: js get data from form 
Javascript :: execute javascript when page finished loading 
Javascript :: join two arrays angular 
Javascript :: jquery alert design 
Javascript ::  
Javascript ::  
Javascript :: flatten in js without lodash 
Javascript :: javascript check if date object 
:: roblox headshot image js 
Javascript :: js today timestamp 
Javascript :: map to array javascript 
:: jquery get all checkbox checked 
Javascript ::  
ADD CONTENT
Topic
Content
Source link
Name
5+6 =