Regular expression – delete comments using Perl

Is there any regular expression that can remove all comments in a given C program // and / ** / var from perl?

Given a multi-line program, it should use regular expressions to remove comments and return the uncommented parts.

Thank you.

Try Regexp::Common::comment:

< /p>

use Regexp::Common qw /comment/;
while (<>) {
s/($RE{comment}{C++})//;
}

Is there any regular expression that can remove all comments in a given C program // and / ** / var from perl?

Given a multi-line program, it should use regular expressions to remove comments and return the uncommented parts.

Thank you.

Try Regexp::Common::comment:

use Regexp::Common qw /comment/;
while (<>) {
s/($RE{comment}{C++})//;
}

< /p>

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5425 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.