Fixed bug in regexp query