前回マッチした部分の続きからマッチさせる

前回マッチした部分の続きからマッチさせる

正規表現オブジェクトmatchに対して(match 'after)とすると,マッチした部分の続きが文字列として得られます.
したがって,

(#/regexp-spec/ (match 'after))

とすると,続きからマッチさせることができます.


何度も適用する例.

(let* ((match (#/\w+/ "abc def ghi jkl"))
       (next-match (#/\w+/ (match 'after)))
       (next-next-match (#/\w+/ (next-match 'after))))
  `(,(match)
    ,(next-match)
    ,(next-next-match)))
  =>("abc" "def" "ghi")