[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
-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Flesler
Sent: Friday, October 26, 2007 8:35 AM
To: jQuery (English)
Subject: [jQuery] Re: Best regex for this, getting software version numbers
Shouldn't that be: [^.]+\.[^.]+ ?
He didn't say he want to capture the first part
At first glance, I thought he needed to escape the '.' the way you
have it, but he doesn't since the [^.] matches everything that isn't a
period, so the wildcard '.' has to match only a real period, so [^.]+.?
[^.]+ works. Still, I think \. makes it clearer.
Danny
On Oct 26, 8:34 am, Flesler
Andy, can you be more specific? I'm not certain from the description exactly
what string you want to extract. If you could list examples of both the
original strings and the expected result strings, that would help. Also
include examples of the edge cases. (Second period? Where?)
-Mike
_
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
@googlegroups.com
Subject: [jQuery] Re: Best regex for this, getting software version numbers
Andy, can you be more specific? I'm not certain from the description exactly
what string you want to extract. If you could list examples of both the
original strings and the expected result strings, that would help
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
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
8 matches
Mail list logo