Re: content suggestion

[email protected] (_brian_d_foy) Thu, 06 Jan 2005 16:11:59 -0600
Newsgroups perl.perlfaq.workers
Message-ID <060120051611599485%[email protected]>
In article <[email protected]>, Paul Apostolik
<[email protected]> wrote:

>    The perlfaq6 manpage: Regular Expressions
>    http://faq.perl.org/perlfaq6.html#How_do_I_use_a_regul
> 
> The regular expression given to match C style multi-line 
> comments is 72 characters long and very poorly reasoned out. I 
> would like to present you with a much more concise alternative:

Your concise alternative doesn't work, and it's just a rewritten
version of the first part of the alternation in the answer.

>    /\*([^\*]*(\*[^/])*)*\*/

     /\*[^*]*\*+([^/*][^*]*\*+)*/


You need to exclude things that look like comments, but really
aren't, such as string literals.  The perlfaq answer does that,
but your answer doesn't.

-- 
brian d foy, [email protected]