I have the following line:
REQUESTED DATE: LPD WRITE UP/OFF PARAMETERS
RUN DATE: 09/06/01 16:30
Now this is just one manifestation of the line or similar lines.
It may or may not have the REQUESTED DATE: phrase.
It may or may not have the RUN DATE: phrase.
I am trying to extract the center section or title which may have ()-/>< characters
interspersed in the title.
Here is my attempt which is failing:
$line =~ s/\s{2,}(\w+(\s?\W?\w+)*).*?/$1/;
Here is my explanation of what I think I am doing (as misguided as I may be :-):
1) \s{2,80} find a string of blanks at least 2 long. This will find the blanks in
front of the title (LPD WRITE UP/OFF PARAMETERS).
2) (\w+(\s?\W?\w+)*) find a word that may or may now be followed by sequences of a
blank or one of the above characters (non-word) followed by another word. In other
words I am thinking of the above title as |LPD| WRITE| UP|/OFF| PARAMETERS|.
2a) (\s?\W?\w+)* I think I am saying that this grouped expression can appear 0 or
more times. My title could very well be 1 word or several.
3) .*? suck up the rest of the line without sucking up the beginning of the line so
the replacement is only $1.
What I get returned in $line is:
REQUESTED DATE:LPD WRITE UP/OFF PARAMETERS RUN DATE:
09/06/01 16:30
I think I have fried my brain (I know......big assumption :-)
TIA
--
-------------------------------------------------------------------------
"They that can give up essential liberty
to obtain a little temporary safety
deserve neither liberty nor safety."
-- Benjamin Franklin
-------------------------------------------------------------------------
RRRRR Gary Luther
RR RR SAF
RR RR UTABEGAS 2500 Broadway
RR RR Helena, MT 59602
RRRR [EMAIL PROTECTED]
RR RR ULE !!
RR RR Visit our website at
RR RR http://www.safmt.org
BEGIN:VCARD
VERSION:2.1
X-GWTYPE:USER
FN:Gary Luther
TEL;WORK:0631
ORG:;Computer Center
TEL;PREF;FAX:(406) 444-0684
EMAIL;WORK;PREF;NGW:[EMAIL PROTECTED]
N:Luther;Gary
TITLE:Systems Administrator
END:VCARD
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]