diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-09-25 23:29:06 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-09-25 23:29:06 -0700 |
commit | 6d3f37d15a926f26d129eb5becd0570172e511ae (patch) | |
tree | c19e2725b66863c8ca2af3050027424273ec48b7 | |
parent | db1f7111a17b64a24bb30d10f192a1e9951b9587 (diff) | |
download | txr-6d3f37d15a926f26d129eb5becd0570172e511ae.tar.gz txr-6d3f37d15a926f26d129eb5becd0570172e511ae.tar.bz2 txr-6d3f37d15a926f26d129eb5becd0570172e511ae.zip |
doc: regex examples.
* txr.1: Examples for f^$, f^ and f$.
-rw-r--r-- | txr.1 | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -32544,6 +32544,27 @@ and between and .codn m$ . +.TP* Examples: + +.cblk + ;; produce list which contains only strings + ;; beginning with "cat": + (keep-if (f^ #/cat/) '#"dog catalog cat fox catapult") + --> ("catalog" "cat" "catapult") + + ;; map all strings in a list to just their trailing + ;; digits. + (mapcar (f$ #/\ed*/) '#"a123 4 z bc465") + --> ("123" "4" "" "465") + + ;; check that all strings consist of digits after + ;; the third position. + (all '#"ABC123 DFE45 12379" (f^$ #/\ed*/ 3)) + --> "79" ; i.e. true + (all '#"ABC123 DFE45 12379A" (f^$ #/\ed*/ 3)) + --> nil +.cble + .SS* Hashing Library .coNP Functions @ make-hash and @ hash .synb |