Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2022-06-30 23:29
Updated·2022-06-30 23:46
Flavor·JavaScript

/
\b(\w+)(?!\s+\1\b)\b
/
gmi
Open regex in editor

Description

Removes all words that are NOT followed by a space, followed by the same word

Submitted by anonymous