RE: [OT] Regular Expression Help

2003-05-30 Thread Mark Galbreath
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]



RE: [OT] Regular Expression Help

2003-05-30 Thread Mark Galbreath
Yiddish?

-Original Message-
From: Xu Cheng [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 29, 2003 8:51 AM

Concrete example will depends on your language.



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



RE: [OT] Regular Expression Help

2003-05-30 Thread Mark Galbreath
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]



Re: [OT] Regular Expression Help

2003-05-29 Thread Xu Cheng
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=<[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, but I am having trouble getting it right. Any help is
> appreciated.
>
> Thanks,
> Hunter
>
>
> -
> 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]



[OT] Regular Expression Help

2003-05-29 Thread Hunter Hillegas
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=<[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, but I am having trouble getting it right. Any help is
appreciated.

Thanks,
Hunter


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



Re: [OT] Regular Expression help

2002-11-28 Thread Gemes Tibor
2002. november 28. 08:53 dátummal Stephen Ting ezt írtad:
> I am new to regular expression.
> In javascript, How to convert a number say in any format 0.0 or 0.000 or
> 0.00 and it will format to 0.(for decimal places)?

What about a javascript mailing list?  Or a simple google search:

http://www.google.com/search?q=format+javascript+decimal

The first result:

http://www.mredkj.com/javascript/numberFormat.html

Tib


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




[OT] Regular Expression help

2002-11-27 Thread Stephen Ting
I am new to regular expression. 
In javascript, How to convert a number say in any format 0.0 or 0.000 or
0.00 and it will format to 0.(for decimal places)?
 
Thanks 
 
regards,
Stephen