Using `RegExp` is error prone, the string needs to be escaped in order to have a safe regexp, and becomes a bit harder to maintain. Is there any reason because you used that instead the regexp literal?