Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(?<=than\s)better(?=\sabsolutely)
/
g

Description

Look ahead Positive(?=)

Find expression A where expression B follows

A(?=B)

Look behind Positive(?<=)

Find expression A where expression B precedes

(?<=B)A

Submitted by anonymous - 9 years ago