BrianBSL has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to extract C comments from source code and drop the code. This link does exactly the opposite: http://learn.perl.org/faq/perlfaq6.html#How-do-I-use-a-regular-expression-to-strip-C-style-comments-from-a-file- Is there any easy way to either invert the regex or reuse it in a different way where it is searched for instead of replaced?
  • Comment on Print what regex finds or invert regex for substitution

Replies are listed 'Best First'.
Re: Print what regex finds or invert regex for substitution
by LanX (Saint) on Mar 17, 2012 at 20:36 UTC
      Thanks very much! That worked.