[#884021] Switch to regex for global flag.