s/ < # match '<' .*? # match anything, but as short as possible (\{|$) # match either '{' or end of line //x