in reply to C style multiple line comment removal

As an aside, consider how the “usual” text-file I/O handlers will themselves look for “newline” delimiters in order to parse out the incoming file as “individual strings” for you ... and that maybe you don’t actually want to do this.

It is probably fairly reasonable to assume that all of the files that you are dealing with are, in fact, of a perfectly reasonable size to simply slurp into memory all at once.   (After all, text editors do that.)   Hence, you can use Perl to read the entire file contents into one string variable ... which will of course therefore contain the newline sequences ... which in this case you don’t care about and specifically want to elide out.   Now, your regular expression can simply search for the /*...*/ sequence, in what is now a single string irrespective of whether or not there are any newline-characters therein.   You use the /g modifier (et al...) in order to apply the regular expression repetitively to the string.

If your purpose is simply to remove the comments, you can also simply use regular expressions to replace each matching comment-entry with an empty string, globally throughout the entire string.   (So the problem is solved with one regular-expression applied one time to the “slurped” content of the file, with no looping or hoary string-manipulation.   Your friendly neighborhood Swiss Army Knife™ at your service...)

As previously noted, this is of course a problem that has been solved before, and whose solution is well-documented.   Find, fetch, and examine that source-code snippet for a concrete example of the application of this idea in practice.