Actually I am wrong about using regular expressions. However I still don't know if the additional memory cost of the big array justifies the benefit given how seldomly this method is used.