If you're interested in the actual patterns and all, here they are.
$noun ="(?: *[A-Za-z0-9._]+\/NN[PS]*)"; $det ="( *[A-Za-z]+\/DT)"; $adj ="( *[A-Za-z]+\/JJ[RS]?)"; $gen ="( *[A-Za-z]+\/POSS)"; $adv="( *[A-Za-z\']+\/RB[RS]?)"; $inf =" *to\/TO"; $adv="( *[A-Za-z\']+\/RB[RS]?)"; $np1="(?:$det|$gen)"; $np2 ="(?:$adj|$num|$conj|$adv|$inf)"; $np3="(?:$np1*\s*(?:$noun)*\s*$np2*\s*(?:$noun)+\s*$adj*)"; $np4="((?:$noun)+\s*$np2+\s*(?:$noun)+)"; $np5="(?:$np1*\s*$adj+\s*($noun)+)"; # more complex noun and prep phrases $NP = "(?:(?:$np1)*\s*(?:$np3)+)"; $NP1 = "(?:$np3)+\s*(?:$np2)\s*(?:$np3)+"; $NP2 = "(?:(?:$np1)+\s*(?:$np3)+\s*(?:$np4)+)"; $NP3 ="(?:$np1*\s*$noun+\s*[^INV]+\s*(?:$noun)+)"; $NP4 ="$np1+\s*[^NV]+\s*$noun+"; $nps= "(?:($NP1)|($NP2)|($NP3)|($NP4)|($NP))"; $extnp="(?:($pro(?!\$))|($np5))";
I'm basically trying to parse text into Noun, Verb, and Preposition Phrases. Nouns are the most troublesome at the moment, because although the individual patterns match what I want in test output, when they are OR'd together, their output is not always correct Thanks

In reply to RE: Re: greedy and lazy by Anonymous Monk
in thread greedy and lazy by Anonymous Monk

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.