Regular Expressions 101

Library entries

Reddit URL Regex

Vote

0

Regular Expression
python

"
^http(?:s)?://(?:www\.)?(?:[\w-]+?\.)?reddit.com(/r/|/user/)?(?(1)([\w:]{2,21}))(/comments/)?(?(3)(\w{5,6})(?:/[\w%\\\\-]+)?)?(?(4)/(\w{7}))?/?(\?)?(?(6)(\S+))?(\#)?(?(8)(\S+))?$
"
gm

Description

Loading markdown...
Submitted by pmdevita - 7 months ago