Last active
August 29, 2015 14:06
-
-
Save zeusdeux/4e13f4de2d3ffe6ca455 to your computer and use it in GitHub Desktop.
Naive URL extraction (only english supported)
This file contains 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 characters
1) Starts with http, https? Cool. Take the whole string (assuming it's good after http|https). Stop | |
2) Contains http, https? Cool. Splice string from index of 'http' ('h' to be more precise) to end of string. Stop. | |
3) Split on '.'. foldr over the array by trying to split ever element over anything that isnt an alphabet or number. Ignore 1st element of every subsplit if the subsplit returns an array of length greater than 1. After this pass, join whole array using '.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment