The regex used non-greedy match, but alas it failed on input like this: <object class="...> ... class="BrightcoveExperience" It captured two objects and the intervening HTML. This commit fixes this by not allowing a ">" to appear before BrightcoveExperience. Video in question: http://www.harpercollinschildrens.com/feature/petethecat/rtmp_test