[pmwiki-devel] Email pattern...

Guillermo Calderon - INCO calderon at fing.edu.uy
Thu May 31 15:04:10 CDT 2007


The Editor wrote:
> On 5/31/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> 
>>On Thu, May 31, 2007 at 06:31:02AM -0400, The Editor wrote:
>>
>>>I put together this pattern to match for emails, but it doesn't seem
>>>to catch something like email at example, ie without a dot in the second
>>>half.
>>>
>>>="/^.+ at .+\..+$/
>>>
>>>Can someone help me spot what I'm missing? Or suggest a better pattern?
>>
>>If you're willing to accept names without dots in the second half,
>>then don't require it:
>>
>>   /^.+ at .+$/
>>
>>This basically says to match any string containing an @ sign somewhere
>>in the middle of the string and no newlines.
> 
> 
> 
> Actually that's what I'm trying to avoid. I want it to fail when there
> is no dot in the second half. Currently it seems to be passing emails
> like that in my form validation. If my initial pattern was correct, I
> suppose it could be a ZAP problem, but it seems more likely the
> problem is in my pattern.
> 

Try using  a double backslash to  escape the dot:

   ="/^.+ at .+\\..+$/"




More information about the pmwiki-devel mailing list