some string match algorithm