diff options
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -3564,9 +3564,10 @@ This directive's syntax is illustrated in this example: The deffilter symbol must be followed by the name of the filter to be defined, -followed by tuples of strings. Each tuple specifies one or more texts -which are mapped to a replacement text. For instance, the following specifies -a telephone keypad mapping from upper case letters to digits. +followed by tuples of forms which evaluate to strings. Each tuple specifies one +or more texts which are mapped to a replacement text. For instance, the +following specifies a telephone keypad mapping from upper case letters to +digits. Quasiliterals may be used. @(deffilter alpha_to_phone ("E" "0") ("J" "N" "Q" "1") @@ -3579,6 +3580,8 @@ a telephone keypad mapping from upper case letters to digits. ("L" "O" "P" "8") ("G" "H" "Z" "9")) + @(deffilter foo (`@a` `@b`) ("c" `->@d`)) + Filtering works using a longest match algorithm. The input is scanned from left to right, and the longest piece of text is identified at every character position which matches a string on the left hand side, and that text is |