As best as I can tell, there are syntax problems with your posted regular expressions. This might just be because the square brackets ( [ ] ) in your post got converted into links. This is because you didn't wrap your code in <code> tags. See Writeup Formatting Tips.

You can get Perl to interpret a regular expression for you using the YAPE::Regex::Explain module off of CPAN. You might use that module something like:

#!/usr/bin/perl use strict; use warnings; use YAPE::Regex::Explain; my $re = qr/regex_here/; print YAPE::Regex::Explain->new($re)->explain();

Alternatively, if you clean up your post or post again, I might be able to explain the results to you.

Update:AnomalousMonk's comment made me reread the above; by "post again" I meant in this thread, but clearly that was inobvious.


In reply to Re: Regular expression Problem by kennethk
in thread Regular expression Problem by archimca

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.