summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev/examples.el4
-rw-r--r--s.el2
2 files changed, 4 insertions, 2 deletions
diff --git a/dev/examples.el b/dev/examples.el
index 66d4dcb..c1ce10f 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -144,7 +144,9 @@
(s-matched-positions-all "{{\\(.+?\\)}}" "{{Hello}} World, {{Emacs}}!" 0) => '((0 . 9) (17 . 26))
(s-matched-positions-all "{{\\(.+?\\)}}" "{{Hello}} World, {{Emacs}}!" 1) => '((2 . 7) (19 . 24))
(s-matched-positions-all "l" "{{Hello}} World, {{Emacs}}!" 0) => '((4 . 5) (5 . 6) (13 . 14))
- (s-matched-positions-all "abc" "{{Hello}} World, {{Emacs}}!") => nil)
+ (s-matched-positions-all "abc" "{{Hello}} World, {{Emacs}}!") => nil
+ (s-matched-positions-all "=\\(.+?\\)=" "=Hello= World, =Emacs=!" 0) => '((0 . 7) (15 . 22))
+ (s-matched-positions-all "=\\(.+?\\)=" "=Hello= World, =Emacs=!" 1) => '((1 . 6) (16 . 21)))
(defexamples s-slice-at
(s-slice-at "-" "abc") => '("abc")
diff --git a/s.el b/s.el
index 4d85eb4..b022ecc 100644
--- a/s.el
+++ b/s.el
@@ -429,7 +429,7 @@ SUBEXP-DEPTH is 0 by default."
(< pos (length string)))
(let ((m (match-end subexp-depth)))
(push (cons (match-beginning subexp-depth) (match-end subexp-depth)) result)
- (setq pos m)))
+ (setq pos (match-end 0))))
(nreverse result)))
(defun s-match (regexp s &optional start)