in reply to Re: Chomping most of a _long_ text string
in thread Chomping most of a _long_ text string
My goodness! Far more replies than I expected!
Regexes are working wonderfully for me, and I'm pleased to say I got the anti-greediness question mark trick myself (but went to work as a waiter, hence not thanking all the replies earlier)
What I was actually parsing was a mailbox full of past issues of @Risk, a security list. My code now has a loop doing something like this:
$$email =~ s/^.+?_{70}\n\n([[:digit:]])/$1/s; while($$email =~ /(\d{2}\.\d+\.\d) CVE: ([^\n]+)\nPlatform: ([^\n]+)\n +Title: ([^\n]+)\nDescription: (.+?)\nRef: (http[^\n]*)/gs) { print "CVE: $2\nPlat: $3\nTitle: $4\nDesc: $5\nURL: $6\n\n"; }
And, yes, I have yet to tidy up the RE, but it works and is more than fast enough for what I need. Many thanks again
Rupert
|
|---|