You are viewing a plain text version of this content. The canonical link for it is here.
Posted to regexp-user@jakarta.apache.org by Kris Gonzalez <ji...@softhome.net> on 2001/05/22 01:08:27 UTC

Re: [:graph:]

no experience with [:graph:], but i can probably help out your re a bit
in another way...

due to internic standards, domains must be alphanumeric and may include
a dash or underscore...also, the last part of an email with either be a
two- or three-digit alpha string...therefore, after your @, your re
might be more useful like this:

[[:alnum:]\._-]+\\.[[:alpha:]]{2,3}$





Eric Goldberg wrote:
> 
> Hello list,
> 
> I am trying to write a re to match email addresses:
> 
>         r = new RE("^[:graph:]+@[:graph:]+\\.[:graph:]+$");
> 
> But this does not match on simple email addresses (e.g. eric@askit.com).
> When I change the graph's to alnum's, it does match.
> 
>         r = new RE("^[:alnum:]+@[:alnum:]+\\.[:alnum:]+$");
> 
> My understanding is that graph includes all printable and visible characters
> (i.e. alnum plus all punctuation).  Am I understanding graph incorrectly?
> Has anyone else experienced unexpected results with [:graph:]?
> 
> --eric

RE: [:graph:]

Posted by Michael McCallum <mi...@spinsoftware.com>.
On 22 May 2001, at 10:55, Eric Goldberg wrote:

> I appreciate your suggestion, Kris.  Thanks.
> 
> I had tried to find an online resource that explained the standards (if any)
> for valid email addresses, but could not find anything of substance.  You
> mentioned the internic standards for email addresses; are these standards
> posted on the Web? (I looked on the internic.org site and could not find any
> reference to email standards.)
try RFC 822 for a start.

> 
> Also, I read on the apache regexp page that nested posix character classes
> are not supported and so I thought an expression like [[:alnum:]\._-] would
> not work.  If I'm wrong here, then does anyone know what is meant by nested
> character classes?
I think it means [:[:foo:]:] but Id have to check the code.

> 
> 
> -----Original Message-----
> From: kris@askit.com [mailto:kris@askit.com]On Behalf Of Kris Gonzalez
> Sent: Monday, May 21, 2001 7:08 PM
> To: regexp-user@jakarta.apache.org
> Subject: Re: [:graph:]
> 
> 
> no experience with [:graph:], but i can probably help out your re a bit
> in another way...
> 
> due to internic standards, domains must be alphanumeric and may include
> a dash or underscore...also, the last part of an email with either be a
> two- or three-digit alpha string...therefore, after your @, your re
> might be more useful like this:
> 
> [[:alnum:]\._-]+\\.[[:alpha:]]{2,3}$
> 
> 



Re: [:graph:]

Posted by Kris Gonzalez <ji...@softhome.net>.
you're right about the nested posix character classes, i'd forgotten
about that...i pasted the regexp from a tcl application i'd written...i
referenced the java code where i'd implemented this and found that i'd
had to work around and use 0-9A-Z instead of [:alnum:]

-kg

Eric Goldberg wrote:
> 
> I appreciate your suggestion, Kris.  Thanks.
> 
> I had tried to find an online resource that explained the standards (if any)
> for valid email addresses, but could not find anything of substance.  You
> mentioned the internic standards for email addresses; are these standards
> posted on the Web? (I looked on the internic.org site and could not find any
> reference to email standards.)
> 
> Also, I read on the apache regexp page that nested posix character classes
> are not supported and so I thought an expression like [[:alnum:]\._-] would
> not work.  If I'm wrong here, then does anyone know what is meant by nested
> character classes?
> 
> -----Original Message-----
> From: kris@askit.com [mailto:kris@askit.com]On Behalf Of Kris Gonzalez
> Sent: Monday, May 21, 2001 7:08 PM
> To: regexp-user@jakarta.apache.org
> Subject: Re: [:graph:]
> 
> no experience with [:graph:], but i can probably help out your re a bit
> in another way...
> 
> due to internic standards, domains must be alphanumeric and may include
> a dash or underscore...also, the last part of an email with either be a
> two- or three-digit alpha string...therefore, after your @, your re
> might be more useful like this:
> 
> [[:alnum:]\._-]+\\.[[:alpha:]]{2,3}$

RE: [:graph:]

Posted by Eric Goldberg <er...@askit.com>.
I appreciate your suggestion, Kris.  Thanks.

I had tried to find an online resource that explained the standards (if any)
for valid email addresses, but could not find anything of substance.  You
mentioned the internic standards for email addresses; are these standards
posted on the Web? (I looked on the internic.org site and could not find any
reference to email standards.)

Also, I read on the apache regexp page that nested posix character classes
are not supported and so I thought an expression like [[:alnum:]\._-] would
not work.  If I'm wrong here, then does anyone know what is meant by nested
character classes?


-----Original Message-----
From: kris@askit.com [mailto:kris@askit.com]On Behalf Of Kris Gonzalez
Sent: Monday, May 21, 2001 7:08 PM
To: regexp-user@jakarta.apache.org
Subject: Re: [:graph:]


no experience with [:graph:], but i can probably help out your re a bit
in another way...

due to internic standards, domains must be alphanumeric and may include
a dash or underscore...also, the last part of an email with either be a
two- or three-digit alpha string...therefore, after your @, your re
might be more useful like this:

[[:alnum:]\._-]+\\.[[:alpha:]]{2,3}$