Use regexp reference instead of "pattern[1..-2]"

Because is does the same thing twice. Regexp marks ("/") are found by
regexp but it isn't used.