Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Pray tell, what does the "pp?" in the following Regexp::Grammar example do/mean? Searching the docs only turns up Tracking and reporting match positions.
#! /usr/bin/perl use strict; use warnings; use 5.010; use Regexp::Grammars; my $grammar = qr{ <delimited_text> <token: delimited_text> qq? <delim> <text=(.*?)> </delim> | <matchpos> qq? <delim> <error: (?{"Unterminated string starting at index $MATCH{match +pos}"})> <token: delim> [[:punct:]]++ }x; use IO::Prompter; while (my $input = prompt) { if ($input =~ $grammar) { use Data::Show; show %/; } else { say 'Failed: '; say for @!; } }
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: qq? with regards to Regexp::Grammars
by hv (Prior) on Jul 04, 2022 at 21:10 UTC | |
by Anonymous Monk on Jul 04, 2022 at 21:26 UTC | |
by perlfan (Parson) on Jul 04, 2022 at 21:30 UTC | |
|
Re: qq? with regards to Regexp::Grammars
by perlfan (Parson) on Jul 04, 2022 at 21:29 UTC | |
by Anonymous Monk on Jul 05, 2022 at 11:42 UTC |