[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [StrongED] Re: Email address launch feature.



In message <ae908c2351.stbruk@sdes_iy02.alandick.com>
          Steve Bradbury <steve.bradbury@xxxxxxxxxxxx> wrote:

> On 7 Jun, "Richard Torrens (lists)" <Lists@xxxxxxxxxxxxxx> wrote:
>
> ><Brainache> Currently this line is emailpart {'A-Za-z0-9_\-'}+
>
>
> The + in there is not in the list of characters - it's there
> to match multiple characters of the set in the brackets.
>
> You need:
>
> {'A-Za-z0-9_\-+'}+

The above can be broken down in two parts:

   - 'A-Za-z0-9_\-+' : this is what is known as a character set. It will
   match any character that is listed in the set. You can specify ranges
   and individual characters, A-Z is a range and matches A through to Z.

   The "\" is used as an escape character to allow the use of characters
   that are part of character set syntax, such as "-" and "'". In the
   above set the "\-" stands for "-", to add "\" to a set use "\\".

   - {..}+ : means that the expression(s) inside it will be applied
   until it fails to match. The "+" at the end dictates that there must
   be at least one match for there to be a positive result.

Hopefully this makes it a bit clearer.


In order to see what other characters are allowed in an email address
I've had a look at the relevant RFCs and have expanded the 'emailpart'
expression to this:

   emailpart    {'A-Za-z0-9_!#$%&\'*+\-/=?^`{|}~'}+

This should cover most email adresses out there although it does omit
more exotic forms, like using quoted strings.

Cheers,

Fred.

-- 
StrongED developer
http://www.stronged.iconbar.com/

-- 
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxxxxx