Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Python

r"
-?(?:\d+(?:\.\d+)?|\.\d+)(?:e\d+)?
"
g

Description

for correctly parsing numbers in SVG attributes like path d or viewBox with regex

  • v2: added support for scientific notation
Submitted by riedler - 3 months ago (Last modified 2 months ago)