js replace text link with anchor tags
var exp_match = /(\b(https?|):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
var element_content=content.replace(exp_match, "<a href='$1'>$1</a>");
var new_exp_match =/(^|[^\/])(www\.[\S]+(\b|$))/gim;
var new_content=element_content.replace(new_exp_match, '$1<a target="_blank" href="http://$2">$2</a>');
Also in JavaScript:
- how to get a bot online on discord
- array to string javascript
- node js check if a user exists in mysql
- fs.writeFileSync in pdfDocument
- alpinejs examples stackoverflow
- nodejs recursively read directory
- array sort
- expresiones ternarias javascript
- TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined at validateString (internal/validators.js:120:11)
- angularjs iframe src binding
- add class to body javascript
- js read date from milliseconds
- react redux counter tutorial
- image compression in nodejs
- Material-ui alarm icon
- remove elements from array js
- how to send data using ajax
- angular for each
- placeholder text disappear when click in react
- lodash npm
- react hooks delete item from array
- ionic not compiling with proxy
- reset value object js
- javascript context color