![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Alternation in Effective Perl Programming Exampleby Carl-Joseph (Scribe) |
on Dec 07, 2000 at 08:16 UTC ( #45438=perlquestion: print w/replies, xml ) | Need Help?? |
Carl-Joseph has asked for the wisdom of the Perl Monks concerning the following question: On page 72, the book Effective Perl Programming shows some code to remove C-style comments from a string. I've reproduced the code below.
I have a question about the regular expression that's used in the call to split(). The expression (:?\\\W|.) seems to say match either a non-word character, or any character. Why have both patterns in the alternation when the dot includes non-word characters? Thanks, Carl-Joseph
Back to
Seekers of Perl Wisdom
|
|