Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Quoted Text rule for Parse::RecDescent?

by ikegami (Pope)
on Aug 23, 2005 at 17:18 UTC( #485962=note: print w/replies, xml ) Need Help??

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]) ]}
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://485962]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2016-08-30 12:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (418 votes). Check out past polls.