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 <[EMAIL PROTECTED]> wrote:
> 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
>
>

Reply via email to