Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 romping around the Monastery: (12)
As of 2015-07-28 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls