http://www.perlmonks.org?node_id=486011


in reply to Quoted Text rule for Parse::RecDescent?

To extra a quotelike string from your text, you just need:

string: <perl_quotelike> { $item[0][2] }

For more details, take a look at: the appropriate section of the documentation.

Damian

Replies are listed 'Best First'.
Re^2: Quoted Text rule for Parse::RecDescent?
by suaveant (Parson) on Aug 26, 2005 at 18:10 UTC
    Ahh... I saw that, but I had some trouble figuring out how to limit it to ' and ", thanks.

                    - Ant
                    - Some of my best work - (1 2 3)

      Presumably now you've worked out that, to restrict it to quoted texts, you need something like:
      string: <perl_quotelike> { my ($marker, $quote, $text) = @{$item[0]}[0..2]; !marker && $quote =~ /['"]/ ? $text : undef }