Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 exploiting the Monastery: (7)
As of 2014-09-23 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (241 votes), past polls