|
|||||
|
|||||
Related Syntax | |||||
pattern |
value-end, =| |
Syntax
value-end
value-end is a positional pattern recognized at the end of a scanned value.
Two forms of the value-end
pattern are available - the long form and the short form, =|
. You should use whatever form leads to the most readable code. For instance, in the following do scan
(where every match alternative is guarded by a value-end
to ensure that only whole values are matched) it is clearly preferable to use the short form:
do scan cgi-data{"PATH_INFO"} drop ~cgi-data{"SCRIPT_NAME"} match "/login" =| login-page match "/guess" =| guess-page else new-page done
But in the following match
statement (that matches any characters up to the next comma or the end of the text), the long form is clearly preferable:
match any** ("," | value-end)
The short form next to the "or" operator (|
)would make a pattern that was hard to read:
match any** ("," | =|)
Related Syntax do scan repeat scan |