Got error 'nothing to repeat at offset 0' from regexp