I am trying to figure out how the search tool in a web browser is being able to parse through the entire web page(assuming huge content on a page) and highlight the result as we type. Does it pre-cache the page while loading in a map or use regex to get a quick result on the fly?
Share
The document is already parsed, by the browser. Searching that document could walk the DOM tree, decide what nodes that could be searched, and inject document nodes to alter the display(such as making the text bold etc).
A standard string matching algorithms can parse through a really huge chunk of text in a second.(think about it, you can run a 3D multiplayer game with collition detection,scene culling, AI,, sound, flashy effects, integrated voice chat, at 60fps on a standard computer, searching a few megabytes of text is nothing..)