You can use a character class to encapsulate the offending asterisk:
Another way would be to use a double backslash to escape it.
There's no need to put the slash inside a character class (or escape it). Also, you will probably need to change the PLUS into a STAR because /**/ is also a valid comment block. And by default, the DOT does not match new line characters, so enabling the DOT-ALL option (?s) would be wise as well. So, that would look like this:
Although parsing source files using regex may not be a wise idea: the substring "/*" may occur inside a string literal which will make the regex match too much.
John de Michele
Joined: Mar 09, 2009
Yep, I was just demonstrating character classes. I guess I got a little 'character-class happy' . You are correct about the asterisk vs. the plus; I guess I didn't think about the empty (i.e., /**/) case.