Create a regexp from a string

Thanks for the explanation @michalmuskala.
Indeed, I used it in tests and faced this problem. Now, it’s clear for me.