The forward slash has no special meaning in regular expressions,
so we can easily match the start of the comment with ‹//
›. Some programming languages
use forward slashes to delimit regular expressions. When you use this
regular expression in your code, you may need to escape the forward
slashes as explained in Recipe 3.1.
‹.*
› simply matches
everything up to the end of the line. We don’t need to add anything to
the regular expression to make it stop at the end of a line. Just make
sure the option “dot matches line breaks” is turned off when using this
regular expression.
Recipe 2.4 explains that the dot matches any character.