'oh {hello there' =~ / ([{]{0,1}) # Matches '' (after some backtracking) hello # Matches 'hello' (?(1)\}) # Matches '' /x; #### 'oh hello} there' =~ / ([{]{0,1}) # Matches '' hello # Matches 'hello' (?(1)\}) # Matches '' /x; #### / {hello} # '{hello}' | (?