Regular Expressions 101

Community Patterns

1...45678...902

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 - 2 months ago (Last modified 2 months ago)