- !Edip#0170
- Katılım
- 1 Eyl 2021
- Mesajlar
- 170
- Tepkime puanı
- 106
- Şehir
- İzmir
JavaScript:
const linksRegex = /((([(https)(http)]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/g;
if (linksRegex.test(message.content) === true) {
// str.match(regex); // returns [ ["", "", ""] ]
const usedLinks = message.content.match(linksRegex).map(d => d.slice(0));
console.log(usedLinks)
}