Lines Matching defs:Perl

3 perlretut - Perl regular expressions tutorial
8 using regular expressions in Perl. It serves as a complement to the
14 Perl is widely renowned for excellence in text processing, and regular
15 expressions are one of the big factors behind this fame. Perl regular
24 could be binary data, for example. Biologists often use Perl to look
29 (blanks added for legibility). We can write in Perl
39 operator along with the C<m//> tell Perl to try to match the pattern
45 or "C<dir *.*>". In Perl, the patterns described by regular expressions
58 loops in the Perl language itself.
72 is harder to pronounce. The Perl pod documentation is evenly split on
73 regexp vs regex; in Perl, there is more than one way to abbreviate it.
90 What is this Perl statement all about? C<"Hello World"> is a simple
92 C<//> enclosing C</World/> tells Perl to search a string for a match.
168 If a regexp matches in more than one place in the string, Perl will
233 If you've been around Perl a while, all this talk of escape sequences
235 strings and in fact the regexps in Perl are mostly treated as
356 match. Perl provides a way of avoiding all those brackets by simply
395 # like those in a Perl variable name
412 interest of saving keystrokes and making regexps more readable, Perl
457 The C</a> modifier, available starting in Perl 5.14, is used to
525 string, rather than just the beginning and end of the string. Perl
566 $x = "There once was a girl\nWho programmed in Perl\n";
590 $x =~ /Perl\Z/m; # matches, "Perl" is at newline before end
591 $x =~ /Perl\z/m; # doesn't match, "Perl" is not at end of string
602 form the regexp C<dog|cat>. As before, Perl will try to match the
604 character position, Perl will first try to match the first
605 alternative, C<dog>. If C<dog> doesn't match, Perl will then try the
607 match fails and Perl moves to the next position in the string. Some
668 to match the next two digits C<\d\d>. So Perl moves on to the next
687 of what Perl does when it tries to match the regexp
747 position, Perl would move to the second character position C<'b'> and
749 possible character positions have been exhausted does Perl give
753 speed things up, Perl compiles the regexp into a compact sequence of
794 For convenience, Perl sets C<$+> to the string held by the highest numbered
839 with Perl 5.10: relative backreferences. To refer to the immediately
871 Perl 5.10 also introduced named capture groups and named backreferences.
900 Yet another capturing group numbering technique (also as from Perl 5.10)
925 In addition to what was matched, Perl also provides the
946 find out what exactly matched in a string. If you use them, Perl
959 If your code is to run on Perl versions earlier than
972 As of Perl 5.10, the C<${^PREMATCH}>, C<${^MATCH}> and C<${^POSTMATCH}>
975 Perl 5.20, C<${^PREMATCH}>, C<${^MATCH}> and C<${^POSTMATCH}> are available
1009 In Perl 5.22 and later, all groups within a regexp can be set to
1091 For all of these quantifiers, Perl will try to match as much of the
1093 with C</a?.../>, Perl will first try to match the regexp with the C<'a'>
1094 present; if that fails, Perl will try to match the regexp without the
1111 One might initially guess that Perl would find the C<at> in C<cat> and
1165 $x = "The programming republic of Perl";
1177 # $2 = 'ing republic of Perl'
1185 # $2 = 'ing republic of Perl'
1194 # $3 = 'ing republic of Perl'
1254 $x = "The programming republic of Perl";
1258 # $3 = ' programming republic of Perl'
1267 # $2 = 'ming republic of Perl'
1278 # $3 = 'ming republic of Perl'
1292 # $3 = 'ing republic of Perl'
1376 no match, Perl will try I<every> possibility before giving up. So be
1398 With the introduction of the I<possessive quantifiers> in Perl 5.10, we
1526 goes for pound signs: use C<\#> or C<[#]>. For instance, Perl allows
1557 Starting in Perl v5.26, specifying C</xx> changes the square-bracketed
1610 =head2 Using regular expressions in Perl
1612 The last topic of Part 1 briefly covers how regexps are used in Perl
1613 programs. Where do they fit into Perl syntax?
1625 If you change C<$pattern> after the first substitution happens, Perl
1712 bit at a time and use arbitrary Perl logic to decide what to do next.
1767 operations in Perl. Search and replace is accomplished with the
1771 I<replacement> is a Perl double-quoted string that replaces in the
1818 expression appears in a loop, Perl is smart enough to compile it
1851 replacement text as Perl code, rather than a double-quoted
1934 capabilities of Perl regexps. In Part 2, we will assume you are
1948 $string =~ /\u$x/; # matches 'Perl' in $string
1985 Perl regexps can handle more than just the
1986 standard ASCII character set. Perl supports I<Unicode>, a standard
1988 languages, and a host of symbols. Perl's text strings are Unicode strings, so
1993 much about Perl's internal representation of strings. But they do need
1999 go further than 255. (Starting in Perl 5.14, if you're an octal fan,
2005 B<NOTE>: In Perl 5.6.0 it used to be that one needed to say C<use
2008 needed. (The only case where it matters is if your Perl script is in
2040 Starting in Perl v5.32, an alternative to C<\N{...}> for full names is
2053 compatibility reasons, but starting in Perl 5.14, any regexp compiled in
2099 and in fact most of the single forms are just Perl-defined shortcuts for common
2118 As if all those classes weren't enough, Perl also defines POSIX-style
2122 C<punct>, C<space>, C<upper>, C<xdigit>, and C<word> (a Perl extension to
2125 they can match the same as their corresponding Perl Unicode classes:
2147 In Part 1 we mentioned that Perl compiles a regexp into a compact
2273 Starting with this section, we will be discussing Perl's set of
2339 In Perl regular expressions, most regexp elements "eat up" a certain
2342 sense that Perl moves to the next character position in the string
2492 like an S<C<'if () {}'>> statement in Perl. If the I<condition> is true,
2494 I<yes-regexp> will be skipped and Perl will move onto the next regexp
2496 in Perl. If the I<condition> is true, the I<yes-regexp> will be
2541 Starting with Perl 5.10, it is possible to define named subpatterns in
2567 This feature (introduced in Perl 5.10) significantly extends the
2568 power of Perl's pattern matching. By referring to some other
2600 =head2 A bit of magic: executing Perl code in a regular expression
2602 Normally, regexps are a part of Perl expressions.
2604 arbitrary Perl code to be a part of a regexp. A code evaluation
2605 expression is denoted C<(?{I<code>})>, with I<code> a string of Perl
2734 Perl may surprise you:
2745 If a regexp has a variable that interpolates a code expression, Perl
2760 then execute arbitrary Perl code. For instance, some joker could
2826 Perl 5.10 introduced a number of control verbs intended to provide
2865 and debug regexps in Perl. We have already encountered one pragma in
2886 The C<re '/flags'> pragma (introduced in Perl
2971 matched. The S<C<< | 1: STAR >>> says that Perl is at line number 1
3005 This is just a tutorial. For the full story on Perl regular
3020 Now maintained by Perl porters.
3022 This document may be distributed under the same terms as Perl itself.