Created
March 31, 2018 00:10
-
-
Save CDRussell/2bb037b4412b94a4b0820f6eaafb35e1 to your computer and use it in GitHub Desktop.
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
private fun parse(url: String): ParseResult { | |
val result = URL_PARSE_REGEX.find(url) | |
if(result == null) { | |
return ParseResult.Error("No match found") | |
} | |
val mimeType = result.groupValues[2] | |
val data = result.groupValues[4] | |
return ParseResult.ParsedData(data, mimeType) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment