Fixed bug with opening regex causing an error