Regular Expressions 101

Community Patterns

Move the selector backwards and forwards

0

Regular Expression
PCRE (PHP <7.3)

/
(?'postion'(?=.y)(?:\K.))
/
gm

Description

Add dots BEHIND the y to make the selection go backwards (the y can be anything you want) and add dots BEFORE the \K to make the selection go forwards. The dot after the \K is to make the selection a whole letter.

Submitted by anonymous - 5 years ago