Last active
October 6, 2018 04:50
-
-
Save abrjagad/1cd92cd3960a84efc1bf737c13a99d6d to your computer and use it in GitHub Desktop.
Revisions
-
Abraham Jagadeesh revised this gist
Oct 6, 2018 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,5 +13,8 @@ var a = `<!DOCTYPE html> <div class="example">See you</div> </body> </html>` //regex from Csstricks.com a.replace(/(<([^>]+)>)/ig,"").replace(/[\n]{1,}/gi,'').split(' ').filter(String); // prints // ["Document", "Hello", "World", "Hi", "Guys", "You", "are", "awesome", "See", "you"] -
Abraham Jagadeesh created this gist
Oct 6, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ var a = `<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <a href="1.html">Hello World</a> <a href="2.html">Hi Guys</a> <a href="3.html">You are awesome</a> <div class="example">See you</div> </body> </html>` a.replace(/(<([^>]+)>)/ig,"").replace(/[\n]{1,}/gi,'').split(' ').filter(String)