On Sep 15, Jeff Pinyan said: >A language written as such could be matched by the following regex: > > $CODE =~ /\A(?: $comment | $string | $other )+\z/xo; That ought to be *, not +. >To match the LAST comment in the code, we'd have to do > > $CODE =~ /($comment)(?: | $string | $other )*\z/xo; That first | is not supposed to be there... -- Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/ PerlMonth - An Online Perl Magazine http://www.perlmonth.com/ The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/ CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/ ==== Want to unsubscribe from Fun With Perl? Well, if you insist... ==== Send email to <fwp-request@technofile.org> with message _body_ ==== unsubscribe