Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
\d+[.]\d+|\d+|[*]+|[/]|[+]|[-]|(?:.+[)])
"
gm

Description

expression will create from example: 2 + 1 + 3 * 510.3 - 50 * (20 - 29 * 2) this: 2,+,1,+,3,,510.3,-,50,,(20,-,29,*,2)

Submitted by NotMEE12 - 2 years ago