fixed bug when static pattern and regexp pattern have the same prefix