kulls,

You've provided some sample data - good!
You've provided the code that you've written so far - excellent!
But - have actually told us what the code is supposed to do?
Some pattern matching obviously, but what are the rules?

Once again, you're asking people to second-guess what it is that you are trying to do. If you expect sensible and helpful answers to your questions, you need to be more explicit.

For example, you might have said: "If the string starts with two word characters, I want to extract the first 13 characters, otherwise I want to extract the first 27 characters"

(That obviously isn't what you are trying to do with your code, but hopefully you get the idea)

Cheers,
Darren :)


In reply to Re: Regular Expression - pattern matching by McDarren
in thread Regular Expression - pattern matching by kulls

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.