Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function validateLink(array){
- let regex = /(www).([a-zA-Z0-9-]+)([.][a-z]*[a-z])+([.][a-z]*[a-z])*/g;
- let result = [];
- for(let sentence of array){
- let match = sentence.match(regex);
- if(match != null) {
- for (let occurrance of match) {
- result.push(occurrance);
- }
- }
- }
- console.log(result.join('\n'));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement