PPIx::R...:Dumper(3)
π PPIx::Regexp::Dumper β bestie, we're dumping regex parses π
okay so real talk, this page is PPIx::Regexp::Dumper(3) from the User Contributed Perl Documentation, and it's literally the glow-up your regex debugging needed. Let's get into it. π¦
β¨ NAME β¨
PPIx::Regexp::Dumper β dump the results of parsing regular expressions. that's it, that's the whole job, and it ate. π
πΈ SYNOPSIS πΈ
use PPIx::Regexp::Dumper;
PPIx::Regexp::Dumper->new( 'qr{foo}smx' )
->print();
see how clean that is?? three lines and you're already spilling the tea about your regex. β¨
π§ INHERITANCE π§
PPIx::Regexp::Dumper is a PPIx::Regexp::Support. it's giving nepo baby in the best way. π
PPIx::Regexp::Dumper has no descendants. zero children. it's an only child, main character energy, no cap. π
π DESCRIPTION π
This class generates a formatted dump of a PPIx::Regexp::Element object (or any subclass thereof, bestie, we don't discriminate), a PPIx::Regexp::Tokenizer object, or a string that can be made into one of these. so basically: hand it a thing, get the whole vibe back in readable form. π«Ά
π METHODS π
This class provides the following public methods. Methods not documented here are private, and unsupported in the sense that the author reserves the right to change or remove them without notice. so like... don't get attached to the undocumented ones, they might ghost you. π
π new π
my $dumper = PPIx::Regexp::Dumper->new(
'/foo/', ordinal => 1,
);
This static method instantiates the dumper. It takes the string, PPI::Element, PPIx::Regexp::Element, or PPIx::Regexp::Tokenizer to be dumped as the first argument. Optional further arguments may be passed as name/value pairs. yes queen, named arguments, we love a structured API. π
The following options are recognized:
default_modifiersarray_reference β This argument is a reference to a list of default modifiers to be applied to the statement being parsed. SeePPIx::Regexpnew()for the details. (iykyk π )encodingname β This argument is the name of the encoding of the regular expression. If specified, it is passed through toPPIx::Regexp->new(). It also causes anEncode::encodeto be done on any parse content dumped. β¨explainBoolean β If true, this option causes theexplain()output of each object to be dumped. we're getting the lore, bestie. πindentnumber β This argument is the number of additional spaces to indent each level of the parse hierarchy. This is ignored if either the"test"or"tokens"argument is true. The default is2. πΈmarginnumber β This is the number of spaces to indent the top level of the parse hierarchy. This is ignored if the"test"argument is true. The default is zero. β¨ordinalBoolean β If true, this option causes the"ordinal"values ofPPIx::Regexp::Token::Literalobjects to be dumped. numbers numbers numbers, we love data. π’perl_versionBoolean β If true, this option causes the"perl_version_introduced"and"perl_version_removed"values associated with each object dumped to be displayed. history lesson fr fr. πppiBoolean β If true, any Perl code contained in the object will be dumped. πͺshortBoolean β If true, leading'PPIx::Regexp::'will be removed from the class names in the output. abbreviation slay. βοΈstrictBoolean β This option is passed on to the parser, where it specifies whether the parse should assume"use re 'strict'"is in effect. The'strict'pragma was introduced in Perl 5.22, and its documentation says that it is experimental, and that there is no commitment to backward compatibility. The same applies to the parse produced when this option is asserted. The default is false.
β οΈ okay so heads up: 'strict' is experimental, and there is no commitment to backward compatibility β the parse you get when this option is asserted gets that same energy. enter at your own risk, bestie. π
significantBoolean β If true, this option causes only significant elements to be dumped. The default is false. we're filtering out the background characters. πtestBoolean β If true, this option causes the output to be formatted as a regression test rather than as a straight dump. The output produced by asserting this option is explicitly undocumented, in the sense that the author reserves the right to change the generated output without notice of any kind. The default is false.
π fr fr, this output is explicitly undocumented and can change without notice of any kind. don't build your whole personality on it.
tokensBoolean β If true, this option causes a dump of tokenizer output rather than of a full parse of the regular expression. This is forced true if the dump is of aPPIx::Regexp::Tokenizer. The default is false. β¨tracenumber β If greater than zero, this option causes a trace of the parse. This option is unsupported in the sense that the author reserves the right to change it without notice. The default is zero. πverbosenumber β If greater than zero, this option causes additional information to be given about the elements found. This option is unsupported in the sense that the author reserves the right to change it without notice. The default is zero. π£οΈwidthBoolean β If true, this option causes a dump of the width of the object. π
If the thing to be dumped was a string, unrecognized arguments are passed to PPIx::Regexp::Tokenizer->new(). Otherwise they are ignored. so like, know your audience β string gets the extra args, everything else just shrugs. π€·ββοΈ
π list π
print map { "$_\n" } $dumper->list();
This method produces an array containing the dump output, one line per element. The output has no left margin applied, and no newlines. raw and unfiltered, just how we like it. π
π print π
$dumper->print();
This method simply prints the result of "string" to standard out. straightforward. iconic. no notes. π
π string π
print $dumper->string();
This method adds left margin and newlines to the output of "list", concatenates the result into a single string, and returns that string. so it's list but with β¨formattingβ¨ and it's one big string. periodt. π
π«Ά SUPPORT π«Ά
Support is by the author. Please file bug reports at <https://github.com/trwyant/perl-PPIx-Regexp/issues> or in electronic mail to the author. found a bug? tell the author, they wanna know bestie. π
π AUTHOR π
Thomas R. Wyant, III harryfmudd at comcast dot net β the legend themselves. π
π COPYRIGHT AND LICENSE π
Copyright (C) 2009-2023, 2025-2026 by Thomas R. Wyant, III
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. (so like, it's free, it's hopeful, but there's no warranty, ok?? don't sue. π)
and that's the whole page, bestie!! this one's perl v5.42.2, dated 2026-06-15, and it's part of the User Contributed Perl Documentation. go dump some regexes and slay. π¦β¨π
π¦ where this page comes from
- fedora 43: perl-PPIx-Regexp 0.092-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-PPIx-Regexp 0.092-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms