Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
(?<=[\s\.\,\!\?\"\;\:]|^)(?=[A-Za-z']*?[bcdfghj-np-tvwxyzBCDFGHJ-NP-TVWXYZ])(?=[A-Za-z']*?[aeiouyAEIOUY'])(?:[A-Za-z](?:'?[A-Za-z]){2}|(?:'?[A-Za-z]){2}[A-Za-z])\b'?(?=[\s\.\,\!\?\"\;\:]|$)
/
gm

Description

finds any 3 letter words in a text

Submitted by anonymous - a year ago