java - Algorithms for string processing -


i have question make me think how improve speed , memory of system. describe example, have file have string:

<e>customer</e>     <a1>customer id</a1>     <a2>customer name</a2> <e>person</e> 

it similar xml file.

now, solution when read <e>customer</e>, read nearest tag , then, substring <e>customer</e> nearest tag.

it make system need process much. used regular expression it. thought same real compiler have phases (lexical analysis, parser).

any ideas?

thanks in advance!

if don't want use 1 of free , reliable xml parsers fast solution involve state machine.

see how create simple state machine in java question start.

please sure have very reason taking route.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -