Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
([\d]+[.][\d]+)|([\d]+)|([\+\-\*\/\^]+)|([\(\)])*
/
g

Description

Includes +, -, /, *, and ^. Can parse decimals. Can parse negative whole numbers and decimals. Can parse parentheses.

Used only for parsing math expressions using regex.

Submitted by anonymous - 9 years ago