Skip to content

Commit 1c80bad

Browse files
committed
Classify regex metachars as "regex". moritz++
1 parent 36a7751 commit 1c80bad

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

lib/Language/regexes.pod

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Otherwise it is L<Nil>.
7979
8080
=head1 Wildcards and character classes
8181
82-
=head2 X<Dot to match any character|regex syntax,.>
82+
=head2 X<Dot to match any character|regex,.>
8383
8484
An unescaped dot C<.> in a regex matches any single character.
8585
@@ -101,7 +101,7 @@ because there is no character to match before C<per> in the target string.
101101
There are predefined character classes of the form C<\w>. Its negation is
102102
written with an upper-case letter, C<\W>.
103103
104-
=item X<\d and \D|regex syntax,\d;regex syntax,\D>
104+
=item X<\d and \D|regex,\d;regex,\D>
105105
106106
C<\d> matches a single digit (Unicode property C<N>), and C<\D> matches a
107107
single character that is not a digit.
@@ -119,7 +119,7 @@ Examples for digits are
119119
U+0E53 ๓ THAI DIGIT THREE
120120
U+1B56 ᭖ BALINESE DIGIT SIX
121121
122-
=item X<\h and \H|regex syntax,\h;regex syntax,\H>
122+
=item X<\h and \H|regex,\h;regex,\H>
123123
124124
C<\h> matches a single horizontal whitespace character. C<\H> matches a
125125
single character that is not a horizontal whitespace character.
@@ -134,27 +134,27 @@ Examples for horizontal whitespace characters are
134134
Vertical whitespaces like newline characters are explicitly excluded; those
135135
can be matched with C<\v>, and C<\s> matches any kind of whitespace.
136136
137-
=item X<\n and \N|regex syntax,\n;regex syntax,\N>
137+
=item X<\n and \N|regex,\n;regex,\N>
138138
139139
C<\n> matches a single, logical newline character. C<\n> is supposed to also
140140
match a Windows CR LF codepoing pair; though it is unclear whether the magic
141141
happens at the time that external data is read, or at regex match time. C<\N>
142142
matches a single character that's not a logical newline.
143143
144-
=item X<\s and \S|regex syntax,\s;regex syntax,\S>
144+
=item X<\s and \S|regex,\s;regex,\S>
145145
146146
C<\s> matches a single whitespace character. C<\S> matches a single
147147
character that is not a whitspace.
148148
149149
TODO: examples
150150
151-
=item X<\t and \T|regex syntax,\t;regex syntax,\T>
151+
=item X<\t and \T|regex,\t;regex,\T>
152152
153153
C<\t> matches a single tab/tabulation character, C<U+0009>. (Note that
154154
exotic tabs like the C<U+000B VERTICAL TABULATION> character are not included
155155
here). C<\T> matches a single character that is not a tab.
156156
157-
=item X<\v and \V|regex syntax,\v;regex syntax,\V>
157+
=item X<\v and \V|regex,\v;regex,\V>
158158
159159
C<\v> matches a single vertical whitespace character. C<\V> match a single
160160
character that is not a vertical whitspace.
@@ -169,7 +169,7 @@ Examples for vertical whitespace characters:
169169
170170
Use C<\s> to match any kind of whitespace, not just vertical whitespace
171171
172-
=item X<\w and \W|regex syntax,\w;regex syntax,\W>
172+
=item X<\w and \W|regex,\w;regex,\W>
173173
174174
C<\w> matches a single word character, that is a letter (Unicode category L),
175175
a digit or an underscore. C<\W> matches a single character that isn't a word
@@ -183,7 +183,7 @@ Examples of word characters:
183183
03F3 ϳ GREEK LETTER YOT
184184
0409 Љ CYRILLIC CAPITAL LETTER LJE
185185
186-
=head2 X«Unicode properties|regex syntax,<:property>»
186+
=head2 X«Unicode properties|regex,<:property>»
187187
188188
The character classes so far are mostly for convenience; a more systematic
189189
approach is the use of Unicode properties. They are called in the form
@@ -265,7 +265,7 @@ C<< <:Ll+:N> >> or C<< <:Ll+:Number> >> or C<< <+ :Lowercase_Letter + :Number> >
265265
(Grouping of set operations with round parens inside character classes is
266266
supposed to work, but not supported by Rakudo at the time of writing).
267267
268-
=head2 X«Enumerated character classes and ranges|regex syntax,<[ ]>;regex assertion,<-[ ]>»
268+
=head2 X«Enumerated character classes and ranges|regex,<[ ]>;regex,<-[ ]>»
269269
270270
Sometimes the pre-existing wildcards and character classes are just not
271271
enough. Fortunately, defining your own is simple enough. Between C<< <[ ]> >>,
@@ -312,7 +312,7 @@ Quantifiers bind tighter than concatenation, so C<ab+> matches one C<a>
312312
followed by one or more C<b>s. This is different for quotes, so C<'ab'+>
313313
matches the strings C<ab>, C<abab>, C<ababab> etc.
314314
315-
=head2 X<One or more: +|regex syntax,+>
315+
=head2 X<One or more: +|regex,+>
316316
317317
The C<+> quantifier makes the preceding atom match one or more times, with
318318
no upper limit.
@@ -322,7 +322,7 @@ like this:
322322
323323
/ \w+ '=' \w+ /
324324
325-
=head2 X<Zero or more: *|regex syntax,*>
325+
=head2 X<Zero or more: *|regex,*>
326326
327327
The C<*> quantifier makes the preceding atom match zero or more times, with
328328
no upper limit.
@@ -331,7 +331,7 @@ For example to optional whitespace between C<a> and C<b> you can write
331331
332332
/ a \s* b /
333333
334-
=head2 X<Zero or one match: ?|regex syntax,?>
334+
=head2 X<Zero or one match: ?|regex,?>
335335
336336
The C<?> quantifier makes the preceding atom match zero or one time.
337337
@@ -343,7 +343,7 @@ C<a ** 2..5> to match the character C<a> at least twice and at most 5 times
343343
If minimal and maximal number of matches are the same, a single integer
344344
is possible: C<a ** 5> to match C<a> exactly five times.
345345
346-
=head1 X<Alternation|regex syntax,||>
346+
=head1 X<Alternation|regex,||>
347347
348348
To match one of several possible alternatives, separate them by C<||>; the
349349
first matching alternative wins.
@@ -379,7 +379,7 @@ match.
379379
Anchors need to match successfully in order for the whole regex to match, but
380380
they do not use up characters while matching.
381381
382-
=head2 X«C<^>, Start of String|regex syntax,^»
382+
=head2 X«C<^>, Start of String|regex,^»
383383
384384
The C<^> assertion only matches at the start of the string.
385385
@@ -388,7 +388,7 @@ The C<^> assertion only matches at the start of the string.
388388
say so 'perly' ~~ /^ perl/; # True
389389
say so 'perl' ~~ /^ perl/; # True
390390
391-
=head2 X«C<^^>, Start of Line and C<$$>, End of Line|regex syntax,^^;regex syntax,$$»
391+
=head2 X«C<^^>, Start of Line and C<$$>, End of Line|regex,^^;regex,$$»
392392
393393
The C<^^> assertion matches at the start of a logical line. That is, either at
394394
the start of the string, or after a newline character.
@@ -420,7 +420,7 @@ leading space, and the third and fourth lines have two leading spaces each).
420420
# and the end of line)
421421
say so $str ~~ / '."' $$/; # True (at the last line)
422422
423-
=head2 X<<<<C<<< << >>> and C<<< >> >>>, left and right word boundary|regex syntax,<<;regex syntax,>>;regex syntax,«;regex syntax>>>>
423+
=head2 X<<<<C<<< << >>> and C<<< >> >>>, left and right word boundary|regex,<<;regex,>>;regex,«;regex,»>>>>
424424
425425
C<<< << >>> matches a left word boundary, so positions where at the left there
426426
a non-word character (or the start of the string), and to the right there is a
@@ -438,7 +438,7 @@ the end of the string.
438438
say so $str ~~ /<< own/; # False
439439
say so $str ~~ /own >>/; # True
440440
441-
=head1 X«Grouping and Capturing|regex syntax,( );regex syntax,[ ];regex syntax,$<capture> =»
441+
=head1 X«Grouping and Capturing|regex,( );regex,[ ];regex,$<capture> =»
442442
443443
In regular (non-regex) Perl 6, you can use parenthesis to group things
444444
together, usually to override operator precedence:

0 commit comments

Comments
 (0)