regular expression for links
http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+If you require HTTP/HTTPS protocol:
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/
_^(?:(?:https?|ftp)://)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)(?:\.(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)*(?:\.(?:[a-z\x{00a1}-\x{ffff}]{2,})))(?::\d{2,5})?(?:/[^\s]*)?$_iuS
Also in JavaScript:
- how to save thing in cookie js
- generate random whole numbers within a range
- return current date in javascript
- convert base64 to image javascript
- export { default as add } from './add.js'; ^^^^^^ SyntaxError: Unexpected token 'export'
- kb to mb js
- prevent adding the item twice in an array javascript
- how to write a program that alerts the current month in words in javascript
- angular injector.create example
- nested json schema mongoose
- js remove json value duplicates
- react lifecycle example
- how to save image in fabruc js json
- js class private
- text align-center js
- express js post request body
- simple return data jquery
- how to add all values of array together js
- error: Error: Unable to resolve module `crypto` from `node_modules\crypto-js\core.js`: crypto could not be found within the project.
- factorial program in javascript
- largest and smallest number in an array 1-100 javascript
- javascript hashtable contains key
- javascript access to xmlhttprequest at from origin 'null' has been blocked by cors policy
- jquery add text to textbox