Regular Expressions 101

Community Patterns

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