Help for this page

Select Code to Download


  1. or download this
    'oh {hello there' =~ /
       ([{]{0,1})  # Matches '' (after some backtracking)
       hello       # Matches 'hello'
       (?(1)\})    # Matches ''
    /x;
    
  2. or download this
    'oh hello} there' =~ /
       ([{]{0,1})  # Matches ''
       hello       # Matches 'hello'
       (?(1)\})    # Matches ''
    /x;
    
  3. or download this
    /
       {hello}   # '{hello}'
    ...
       hello     # 'hello'
       (?! } )   # Not followed by '}'
    /x