Search algorithm for text editor

Revision en1, by gooo, 2016-05-18 22:58:47

Hi, I'm implementing text editor, text will be stored in multiple chunks of continuous buffers (each of 1k-2k bytes). Obviously, text could change at any time and place.

What algorithms do you suggest (and why) for a) substring search, b) regexp search? I don't have any better idea than apply any of common search algorithms (possibly in parallel for each part of text).

If it helps, query string would be probably much shorter than whole text; most words will occur multiple times in text; text files will be probably smaller than 300k.

Tags search, text, editor

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English gooo 2016-05-18 22:58:47 585 Initial revision (published)