PPI::Token::Regexp(3)

πŸ’– PPI::Token::Regexp β€” the regexp glow-up page πŸ’–

okay bestie, you've landed on PPI::Token::Regexp(3) from the User Contributed Perl Documentation collection. pull up a chair, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

PPI::Token::Regexp β€” the regular expression abstract base class, and she's literally the blueprint. πŸ‘‘


🌸 INHERITANCE 🌸

the family tree, and yes it's giving royal lineage:

PPI::Token::Regexp
isa PPI::Token
    isa PPI::Element

so she inherits from PPI::Token, which inherits from PPI::Element. iconic chain, no notes. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: the PPI::Token::Regexp class is never instantiated. like, never ever. she doesn't do the work herself, she just shows up as the shared abstract base class for the three regular expression classes. and those three are:

  • m// β†’ PPI::Token::Regexp::Match πŸŽ€
  • s/// β†’ PPI::Token::Regexp::Substitute ✨
  • tr/// β†’ PPI::Token::Regexp::Transliterate 🌈

the names are, like, hopefully obvious enough that nobody has to explain what each class does. go check their own pages if you want the full scoop, bestie.

and real quick, to save you from some confusion: it's worth pointing out right here that qr// is not a regular expression. nope! because when PPI says "regular expression," it means something that will actually examine or modify a string. qr// is a quote-like operator that acts as a constructor for compiled Regexp objects. different vibe entirely. iykyk. πŸ’€


πŸ’… METHODS πŸ’…

the following methods are inherited by this class' offspring (so the whole lil regexp fam gets them):

  • get_match_string β€” returns the portion of the regexp that performs the match. 🎯
  • get_substitute_string β€” returns the portion of the regexp that gets substituted in for the match, if there is any. and if the regexp doesn't substitute? you get undef back. sorry bestie, that's the deal. πŸ™ˆ
  • get_modifiers β€” returns the modifiers of the regexp. ⭐
  • get_delimiters β€” returns the delimiters of the regexp as an array. the first element is the delimiters of the match string, and the second element (if any) is the delimiters of the substitute string (if any). two slots, very tidy. 🧚

🫢 SUPPORT 🫢

see the support section in the main module. that's where the help lives, go look. πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

Adam Kennedy <adamk@cpan.org>


Copyright 2001 - 2011 Adam Kennedy.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.


no cap, that's the whole page. every flag, every class, every undef β€” all accounted for. periodt. πŸ”₯

so yeah, this was PPI::Token::Regexp(3), and the footer energy is: perl v5.42.0, dated 2026-01-17. mwah, go forth and parse some regexps, main character. πŸ’–βœ¨

πŸ“¦ where this page comes from