Boyer-Moore fast string search algorithm

Share your advanced PureBasic knowledge/code with the community.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Was looking for some fast search options and happened on this thread.

Mr Vooijs' search above seemed very good for my needs, but seemed to fail if the search string is only 1 char.

Changing line 35 to
CMP Ecx, 0 ; compare to length of zero since the jmp is for a greater than

appears to fix the problem, but since assembler is no longer my forte (since 35 years ago), you may want to test it first :)

cheers
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Post by pdwyer »

Paul Dwyer

“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Post Reply