Dave Newton wrote:

Replied to list.

rama chandrula wrote:
I have the following Regex in Java
[A-Za-z0-9]+([_.*-]?[A-Za-z0-9]+)[EMAIL PROTECTED]([.-]?[A-Za-z0-9]+)*

Any tips to convert so that it will work with ORO.
Yes; use the 'email' built-in validator rule from commons-validator.

I'm not very familiar with ORO so I can't comment on that. I will agree with Dave's comment for two reasons:
1) it's there and so why invent the wheel
2) your regexp above will fail to match some legal email names, again pushing me towards (1) - someone else has already done the work

For interest, last time I read the RFC (sorry I can't recall the #) the local part of the name is supposed to be interpreted by the owning email system only, all other sending and forwarding agents should make no assumptions about what is or can be in the local part (the part before the @). So there are many other characters that can legally appear. If I have to do my own regexp I typically use something like
[EMAIL PROTECTED]@[A-Za-z0-9_-]. etc

Regards
Brett Connor


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to