in reply to Req expression translation
Let's start with the "@myinfo.com/" part. The dot is going to match any character, so it could, in fact, match "@myinfo9com" At least the dot and @ should be escaped like this: "\@myinfo\.com/"
The other problem is the [\w.-]+ character class, which will let in any amount of dots or hyphens or word characters, in any order. Imagine an email address like this: "---...@myinfo.com". This RE will allow that.
The RE would be more effective like this:
/^(?:[\w\d]+[.-]?)+\@myinfo\.com$/
While that might still reject a potentially valid address, or accept a potentially invalid address, at least it's limited to one server, and will be acceptible 99% of the time.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Req expression translation
by dragonchild (Archbishop) on Dec 12, 2003 at 18:39 UTC |