Back to articles
Beautiful Perl feature: reusable subregexes

Beautiful Perl feature: reusable subregexes

via Dev.to TutorialLaurent Dami

Beautiful Perl series This post is part of the beautiful Perl features series. See the introduction post for general explanations about the series. Perl is famous for its regular expressions (in short: regexes ): this technology had been known for a long time, but Perl was probably the first general-purpose programming language to integrate them into the core. Perl also augmented the domain-specific sublanguage of regular expressions with a large collection of extended patterns ; some of these were later adopted by many other languages or products under the name "Perl-compatible regular expressions". The whole territory of regular expressions is a vast topic; today we will merely focus on one very specific mechanism, namely the ability to define reusable subregexes within one regex. This powerful feature is an extended pattern not adopted yet in other programming languages, except those that rely on the PCRE library , a C library meant to be used outside of Perl, but with a regex diale

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
3 views

Related Articles