Pegex:...::Atoms(3pm)

πŸ“¦
version 0.75 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Pegex::Grammar::Atoms β€” literally the Pegex Regex Atoms, bestie πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

use Pegex::Grammar::Atoms;

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so Atoms are these special Pegex rules, right? And what they do is represent the tiny little pieces of text you use to build up regular expressions. Usually they're like one or two characters. Small. Iconic. Doing the most with the least. πŸ’–

Now, you might be sitting there like "girl why would I write COLON in a regex when I could just type :" and honestly? Valid question. But there are three reasons this is encouraged, and they all ate:

  1. You're defining a grammar for a new language, so it's genuinely worth the time to be clear and verbose. Say what you mean, periodt.
  2. Using an abstraction like this can help with portability to languages with different regex engines. Slay, cross-platform.
  3. It makes the grammar for Pegex so much simpler, because a / is always a part of the Pegex syntax, and a SLASH is part of your grammar. The way that works is just… chef's kiss. πŸ‘‘

🌸 AUTHOR 🌸

Ingy dΓΆt Net</purl> β€” wait, typo, let me fix that: Ingy dΓΆt Net <ingy@cpan.org> 🫢


Copyright 2010-2020. Ingy dΓΆt Net.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Fr fr, go wild. 🌈

See <http://www.perl.com/perl/misc/Artistic.html>


and that's the whole page, bestie πŸŽ€βœ¨ no cap, that's it β€” this little writeup was served to you by perl v5.36.0, dated 2022-11-19. mwah πŸ’‹

πŸ“¦ where this page comes from