Regex Tuesday Challenge - Week Thirteen

Regex Tuesday Challenge #13 is to match strings which have a word repeated directly below the same word on the previous line (see the test cases if that isn't clear). The font is mono-spaced today, so the lines are all the same width. Be aware that the line wraps by itself if the last word is too long.

To test a regular expression on the test cases below, type it into the text input. Each test case will be marked as passed or failed respectively - you are aiming to get as many test cases as you can to pass. Note that JavaScript must be enabled for this feature to work. The regex engine used is the JavaScript regex engine; it is similar to PCRE, but with a few differences.

Test cases (0/8)

This sentence is pretty long and this sentence is also a test
match

This sentence is also long and this sentence is a test
match

This sentence shouldn't match
no match
This sentence also shouldn't match as this has no words below.
no match


Hello world, this exclamation of surprise has this by surprise
match

Hello world, this exclamation of surprise is this by surprise
no match

While there are no repeated words on the first line, these words repeat again on this line.
match


"No!", shouted the boy, crying. "No!"
match
Congratulations, your regex passes all the test cases! Remember to share this challenge.