Regular Expressions 101

Community Patterns

Combining Like Terms

1

Regular Expression
PCRE (PHP <7.3)

/
((\d+\.?\d*) ([a-zA-Z]) \*)(.*?)(((\d+\.?\d*) \3 \*))
/
g

Description

This is my first attempt at making a regex that combines like terms in postfix notation.

Submitted by sirob_vious - 8 years ago