summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-09-26 06:53:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-09-26 06:53:30 -0700
commit36f8481e4029ce04776e222653ab3e5aff0c9cd7 (patch)
treeb0ea6a0ba625a23a5a2b5138ca71c35bea4c3da1
parent75e61c9d4d8b4d41d4ec9150d1b791eeeda9d1a0 (diff)
downloadtxr-36f8481e4029ce04776e222653ab3e5aff0c9cd7.tar.gz
txr-36f8481e4029ce04776e222653ab3e5aff0c9cd7.tar.bz2
txr-36f8481e4029ce04776e222653ab3e5aff0c9cd7.zip
doc: new regsub example.
* txr.1: Left-anchored match in regsub with r^.
-rw-r--r--txr.13
1 files changed, 3 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 87841e16..738eca10 100644
--- a/txr.1
+++ b/txr.1
@@ -32101,6 +32101,9 @@ which indicates that no replacement is to take place.
;; Replace Hello with Goodbye:
(regsub #/Hello/ "Goodbye" "Hello world!") -> "Goodbye world!"
+
+ ;; Left-anchored replacement with r^ function:
+ (regsub (op r^ #/H/) "J" "Hello, hello!") -> "Jello, hello!"
.cble
.coNP Function @ regexp