I have a string that contains sequences delimited by multiple characters: << and >>. I need a regular expression to only give me the
<<
>>
$string = 'do not match this <> not this <> IT HAS CHILDREN>> < this>>'; @matches = $string =~ /(<<(?:[^<>]+|<(?!<)|>(?!>))*>>)/g;