struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xu Cheng <xucheng_...@yahoo.com.sg>
Subject Re: [OT] Regular Expression Help
Date Thu, 29 May 2003 12:51:12 GMT
you can define the pattern to be something like: 
form=<([^>]+)>
and then apply it to the string and get value of $1.
I can't remember if < and > are special characters. If they are, you can add \ 
in front to escape them. I don't have a reference with me so can't give you 
the exact answer.

Concrete example will depends on your language.

On Thursday 29 May 2003 07:54, Hunter Hillegas wrote:
> This is off-topic but if someone could help, that would be great.
>
> Please respond off list.
>
> I need help with a regular expression. These are always hard for me.
>
> I have several lines of input like this:
>
> maillog-May 26 16:29:50 vader sendmail[22129]: h4QLTob22129:
> from=<some_address@hotmail.com>, size=967, class=0, nrcpts=1,
> msgid=<Law10-F9MWEVywvf2lG0002942e@hotmail.com>, proto=ESMTP, daemon=MTA,
> relay=f9.
> law10.hotmail.com [64.4.15.9]
>
> I want to extract just the from address (some_address@hotmail.com) and send
> it to output, but I am having trouble getting it right. Any help is
> appreciated.
>
> Thanks,
> Hunter
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message