1
0
Fork 0

- quote meta characters when matching for RE, searching for a common prefix from a bag of strings.

This commit is contained in:
cage 2021-04-16 18:34:27 +02:00
parent b4b9e57c56
commit d9ebbe84ab
2 changed files with 17 additions and 15 deletions

View File

@ -118,7 +118,9 @@
(setf res (strcat res (string (elt pivot-string prefix-count)))))
(%advance ()
(loop for i in actual-strings do
(when (not (cl-ppcre:scan (strcat "^" res) i))
(when (not (cl-ppcre:scan (strcat "^"
(cl-ppcre:quote-meta-chars res))
i))
(setf res (subseq res 0 (1- (length res))))
(return-from %advance nil)))
(when (< (1+ prefix-count)