What it does
Find a word repeated right after itself, such as "is is", using a backreference.
How to use it
- Load the example or paste your text.
- Group 1 is the repeated word.
- Check the counterexample.
Verified example
Example
Text "this is is a test"
\b([A-Za-z]+)\s+\1\b Result: "is is"
\b([A-Za-z]+)\s+\1\b Result: "is is"
\b([A-Za-z]+)\s+\1\b Result: "is is"
Counterexample
Text "this is a test"
\b([A-Za-z]+)\s+\1\b Result: no match
\b([A-Za-z]+)\s+\1\b Result: no match
\b([A-Za-z]+)\s+\1\b Result: no match
Recorded by running fixture FX-R09 on : rp.js@1 on Node v24.21.0 (V8), v24.21.0, CPython 3.14.2 (Pyodide 314.0.7), PCRE2 10.48, go1.27.1. JavaScript results come from the rp.js@1 core on Node’s V8; your browser runs the same core.
Engines
- Go regexp has no backreferences, so Go is not offered for this recipe.
Limits
- Case-sensitive and ASCII words only.