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