Shouldn't that be: [^.]+\.[^.]+  ?
He didn't say he want to capture the first part, and '.?' will match
something else.

Just in case you are interested, you can achieve the same using:
       s.substring( 0, s.indexOf( '.' ,s.indexOf('.')+1 ));

Ariel Flesler

On Oct 25, 10:05 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
> That's better than mine (or at least shorter). Thanks!
>
>   _____  
>
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Michael Geary
> Sent: Thursday, October 25, 2007 4:52 PM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: Best regex for this, getting software version numbers
>
> Call me stupid. You did provide exactly the information I was asking for in
> my other message, I was just not paying close enough attention. D'oh!
>
> You could probably simplify the RE to this:
>
> ([^.]+).?[^.]+
>
> -Mike
>
>   _____  
>
> From: Andy Matthews
> I came up with this:
>
> ([a-zA-Z0-9 !]+).?([a-zA-Z0-9]+)
>
> Is there a better way to do this?
>
>   _____  
>
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Andy Matthews
> Sent: Thursday, October 25, 2007 4:32 PM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Best regex for this, getting software version numbers
>
> I have these strings:
>
> Firefox 2.0.0.8 (Firefox 2.0)
>
> Internet Explorer 7.0 (Internet Explorer 7.0)
>
> Googlebot 2.1 (Googlebot 2.1)
>
> Yahoo! Slurp (Yahoo! Slurp)
>
> etc.
>
> I'd like to grab everything up to a second period (if it exists). What I
> want is in parens next to each string.
>
> Anyone have any ideas?
>
> ____________________________________
>
> Andy Matthews
> Senior ColdFusion Developer
>
> Office:  877.707.5467 x747
> Direct:  615.627.9747
> Fax:  615.467.6249
> [EMAIL PROTECTED]<http://www.dealerskins.com/>
>
>  atte6357.bmp
> 6KDownload

Reply via email to