File: demo_debug.pl

package info (click to toggle)
libregexp-grammars-perl 1.036-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,228 kB
  • ctags: 89
  • sloc: perl: 53,272; makefile: 4
file content (24 lines) | stat: -rw-r--r-- 457 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use 5.010;
use warnings;

    use Regexp::Grammars;

    my $balanced_brackets = qr{
        <debug:step>

        <left_delim=(  \( )>
        (?:
            <[escape=(  \\ )]>
        |   <recurse=( (?R) )>
        |   <[simple=(  .  )]>
        )*
        <right_delim=( \) )>
    }xms;

    while (<>) {
        if (/$balanced_brackets/) {
            say 'matched:';
            use Data::Dumper 'Dumper';
            warn Dumper \%/;
        }
    }