Regular Expressions 101

Community Patterns

1...45678...902

Community Library Entry

0

Regular Expression
Python

r"
(```|`)(python)?\s*?\n?(from \S+ )?import \S+(\n.*?;)*\n((.*return \S+```)|(`return \S+`))
"
gm

Description

A regex that matches comments that adhere to the rules of r/ProgrammerHumor

Submitted by anonymous - a year ago