Skip to content
Advertisement

regex for repeating word to repeating two words

I am trying to write some regex pattern that will look through a sentence and remove any one or two sequentially repeated words

for example:

JavaScript

Desired outputs are

JavaScript

Advertisement

Answer

Try

JavaScript

-output

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement