Hello

I had this figured out at one time, then changed the way I did things and didn't really need it, but now I need it again for a few instances.

Unfortunately I can not find the final version that I actually used.

I am trying to trim down a string from NWS weather alerts. Here is an example:

...FLASH FREEZE AND AREAS OF BLACK ICE... Temperatures will continue t +o fall in the wake of a strong cold front as brisk and gusty west to +northwest winds usher in much colder air. As temperatures drop into t +he 20s lingering standing water on roads and other untreated surfaces + will freeze up creating hazardous driving and walking conditions. In + addition,

All I need is what is between the first "..." and the second "..." and nothing else.

...FLASH FREEZE AND AREAS OF BLACK ICE...

Sometimes they use the 3 dot pattern in more than one place, I only really want the first set.

What I could find that was the last entry in my notes is this:

$summary =~ s/\Q...\E/.../g;

But that is not working correctly. I have tried a few other ways, but I am not having any luck.

Any help would be greatly appreciated as always. Thank you!


In reply to Regex string trimming help by johnfl68

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.