Adding the slashes manually allows you to add modifiers after the slashes like i, m, or u, which gives you more flexibility in your regular expression generation. The reason that we don't add the slashes automatically is the same as why php doesn't.
See: https://www.w3schools.com/php/php_regex.asp