Oops...off in ASP land again.  The second array is not needed.

-----Original Message-----
From: Mark Galbreath [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 29, 2003 9:57 AM
To: 'Struts Users Mailing List'
Subject: RE: [OT] Regular Expression Help


Regular expressions are valuable to Struts developers, too.  :-) Using J2SE
1.4, you could:

String[] temp_1 = new String[ 3 ];
temp_1 = line.split( "<" );
String[] temp_2 = new String[ 1 ];
String email = temp_1[ 1 ].split( ">" );

or

import java.util.regex.Pattern;
import java.util.regex.Matcher;

Patter p = Pattern.compile( "<[^>](.*)>" );
Matcher m = p.matcher( line );

if( m.group() != null ) {
  String email = m.group();
}

Mark

-----Original Message-----
From: Hunter Hillegas [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 28, 2003 7:55 PM

I have several lines of input like this:

maillog-May 26 16:29:50 vader sendmail[22129]: h4QLTob22129:
from=<[EMAIL PROTECTED]>, size=967, class=0, nrcpts=1,
msgid=<[EMAIL PROTECTED]>, proto=ESMTP, daemon=MTA,
relay=f9. law10.hotmail.com [64.4.15.9]

I want to extract just the from address ([EMAIL PROTECTED]) and send
it to output....



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to