Regular Expressions 101

Community Patterns

Community Library Entry

-3

Regular Expression
Python

r"
([0-9]*\.?[0-9]*)\s*%
"
gmi

Description

Only captures value for converting percentage to decimal. Returns empty if percentage but no value. no match = no percentage found

Submitted by sharkey - 10 years ago