Community Patterns

Community Library Entry

12

Regular Expression
Created·2015-03-12 09:23
Flavor·Python

r"
(^https?://)?(\w+)?\.?(reddit\.com/|redd\.it/)(r/\w+/)?(comments/)?(\w+)
"
gm
Open regex in editor

Description

Simply searches for the thread-id in any kind of valid reddit-URL.

Submitted by Mio