Help for this page

Select Code to Download


  1. or download this
    { # Place this block at the top of the grammar, before any rules.
       use Text::Balanced qw( extract_quotelike );
    }
    
    string: { [ $item[0], scalar extract_quotelike($text) ] }
    
  2. or download this
    { # Place this block at the top of the grammar, before any rules.
       sub dequote_double {
    ...
    
    string : /"(?:[^\\"]|\\.)*"/  {[ $item[0], dequote_double($item[1]) ]}
           | /'(?:[^\\']|\\.)*'/  {[ $item[0], dequote_single($item[1]) ]}