regexpパッケージで日本語を
概要
regexpパッケージで日本語を使う場合は、regexp:match-stringを使わずに自分で書きましょう
そうしないと、うまく文字列を切り出す事ができません。
;; バイト単位のsebseq(utf-8限定) (defun subseq-byte(str from &optional to) (ext:convert-string-from-bytes (subseq (ext:convert-string-to-bytes str charset:utf-8) from to) charset:utf-8)) ;; regexp:match-stringの日本語版 (defun match-string-jp(str match) (subseq-byte str (regexp:match-start match) (regexp:match-end match)))
原因
つまり
(char "あa" 1) ; => #\a (regexp:match "a" "あa") ; => #S(REGEXP:MATCH :START 3 :END 4)
ということ。