Skip to content

Commit ebbdc62

Browse files
authored
Merge pull request #3295 from tinmarino/merge_index_regex
Feature: Index regex interpolation tokens
2 parents d9671fb + c5b97ad commit ebbdc62

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

doc/Language/regexes.pod6

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ There are two variants: lookahead and lookbehind assertions.
11871187
Technically, anchors are also zero-width assertions, and they can look
11881188
both ahead and behind.
11891189
1190-
=head2 X«Lookaround assertions|regex,positive lookaround assertion;regex,negative lookaround assertion»
1190+
=head2 X«Lookaround assertions|regex,positive lookaround assertion, <?>;regex,negative lookaround assertion, <!>; regex ?[ »
11911191
11921192
Lookaround assertions work both ways. They match, but they don't consume a
11931193
character.
@@ -1219,7 +1219,7 @@ negative lookaround assertion behaves in the same way. In the fourth
12191219
statement the last digit is matched but not consumed, thus the match includes
12201220
only the first two digits.
12211221
1222-
=head2 X<Lookahead assertions|regex,before>
1222+
=head2 X«Lookahead assertions|regex, before;regex, <?before>»
12231223
12241224
To check that a pattern appears before another pattern, use a
12251225
lookahead assertion via the C<before> assertion. This has the form:
@@ -1269,7 +1269,7 @@ that are followed by a unit (like I<kg>), but not other numbers:
12691269
Since the lookahead is not part of the match object, the unit
12701270
is not substituted.
12711271
1272-
=head2 X<Lookbehind assertions|regex,after>
1272+
=head2 «Lookbehind assertions|regex, after; regex, <?after>»
12731273
12741274
To check that a pattern appears after another pattern, use a
12751275
lookbehind assertion via the C<after> assertion. This has the form:
@@ -1894,6 +1894,7 @@ pattern, which may be summarized as follows:
18941894
18951895
=end table
18961896
1897+
X<|regex, $variable>X<|regex, $(code)>
18971898
Let's start with the first two syntactical forms: C«$variable» and C«$(code)».
18981899
These forms will interpolate the stringified value of the variable or the
18991900
stringified return value of the code literally, provided that the respective
@@ -1969,6 +1970,7 @@ interpolation. Hence, in general, after possible stringification, C«$variable»
19691970
and C«$(code)» provide for a strictly literal match of the variable or return
19701971
value.
19711972
1973+
X«|regex, <$variable>»X«|regex, <{code}>»
19721974
Now consider the second two syntactical forms from the table above:
19731975
C«<$variable>» and C«<{code}>». These forms will stringify the value of the
19741976
variable or the return value of the code and interpolate it as a regex. If the
@@ -2019,6 +2021,7 @@ The use of hashes in regexes is reserved.
20192021
20202022
=head2 Regex boolean condition check
20212023
2024+
X«|regex, <?{}>;regex, <!{}>»
20222025
The special operator C«<?{}>» allows the evaluation of a boolean expression that
20232026
can perform a semantic evaluation of the match before the regular expression
20242027
continues. In other words, it is possible to check in a boolean context a part

0 commit comments

Comments
 (0)