Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Quoted Text rule for Parse::RecDescent?

by ikegami (Patriarch)
on Aug 23, 2005 at 17:18 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://485962]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2024-04-18 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found