Boyer-Moore string search: Difference between revisions
m
→{{header|Emacs Lisp}}
m (→{{header|J}}: stay closer to the spirit of the algorithm) |
|||
Line 38:
(let ((idx patLen)
(skip
(while (and (
;; skip when the character at position idx is different
(when (/= (elt pattern idx) (elt text (+ startPos idx)))
Line 46:
)
)
(if
(setq startPos (+ startPos skip))
(setq result startPos)
|