Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
__([a-zA-Z_]+)__\s*=\s*(?:\"|')((?<=\").+(?=\")|(?<=').+(?='))
"
gm

Description

Regex string that can pull package metadata from python file when its stored in this method:

mymeta = 'some meta string'

Submitted by anonymous - 6 years ago