m{ \A # anchor to start (\W) # open text (?: (?!\1) . )* # anything that isn't the closer \1 # close text (\W) # separator }xs