Hello Monks,

I have a doubt on how to take the total UC words out of a line.

Example1:

---------

$string = "BROUGHTON VETERINARY GROUP. Leicestershire mixed practice seeks experienced vet to replace assistant relocating to Scotland";

Here I need to take out the "BROUGHTON VETERINARY GROUP" in a new $string_new.

Example2:

---------

$string = "GIRLING AND BOWDITCH VETERINARY SURGEONS We are looking for an experienced vet for our 5 vet mixed practice.";

Here I need to take out the "GIRLING AND BOWDITCH VETERINARY SURGEONS" in a new $string_new.

Example3:

---------

$string = "STANHOPE PARK VETERINARY HOSPITAL. Due to a pregnancy epidemic we are looking for 2 new vets, 100% small animal hospital in County Durham.";

Here I need to take out the "STANHOPE PARK VETERINARY HOSPITAL" in a new $string_new.

Dear Monks Is it possible using a regex? Kindly help!

Thanks in advance.


In reply to Perl Regex to take the UC Words. 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.