Regex for parsing subreddit, IDs, and URL params out of a Reddit URL. Battle-hardened and tested for over three years on Reddit bots GifReversingBot, vredditshare, and switcharoohelper.
Returns the following information if it is exists in a Reddit URL
/r/ or /user/ depending on whether this is in ...
Submitted by pmdevita - 2 years ago