Trim url before parsing
Use built in AOSP pattern to match URLs