Differences

This shows you the differences between two versions of the page.

Link to this comparison view

emailregexp [2011/05/27 12:08] (current)
brot created
Line 1: Line 1:
 +====== regexp zum filtern valider Email-Addressen ======
 +
 +Immer mal wieder notwendig: ein regexp um email-addressen zu validieren. Auf http://​fightingforalostcause.net/​misc/​2006/​compare-email-regex.php hat sich jemand mit dem Thema beschäftigt,​ und folgende regexp hat am besten abgeschnitten:​
 +
 +<​code>​
 +/​^(?​!(?:​(?:​\x22?​\x5C[\x00-\x7E]\x22?​)|(?:​\x22?​[^\x5C\x22]\x22?​)){255,​})(?​!(?:​(?:​\x22?​\x5C[\x00-\x7E]\x22?​)|(?:​\x22?​[^\x5C\x22]\x22?​)){65,​}@)(?:​(?:​[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:​\x22(?:​[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:​\x5C[\x00-\x7F]))*\x22))(?:​\.(?:​(?:​[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:​\x22(?:​[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:​\x5C[\x00-\x7F]))*\x22)))*@(?:​(?:​(?​!.*[^.]{64,​})(?:​(?:​(?:​xn--)?​[a-z0-9]+(?:​-[a-z0-9]+)*\.){1,​126}){1,​}(?:​(?:​[a-z][a-z0-9]*)|(?:​(?:​xn--)[a-z0-9]+))(?:​-[a-z0-9]+)*)|(?:​\[(?:​(?:​IPv6:​(?:​(?:​[a-f0-9]{1,​4}(?::​[a-f0-9]{1,​4}){7})|(?:​(?​!(?:​.*[a-f0-9][:​\]]){7,​})(?:​[a-f0-9]{1,​4}(?::​[a-f0-9]{1,​4}){0,​5})?::​(?:​[a-f0-9]{1,​4}(?::​[a-f0-9]{1,​4}){0,​5})?​)))|(?:​(?:​IPv6:​(?:​(?:​[a-f0-9]{1,​4}(?::​[a-f0-9]{1,​4}){5}:​)|(?:​(?​!(?:​.*[a-f0-9]:​){5,​})(?:​[a-f0-9]{1,​4}(?::​[a-f0-9]{1,​4}){0,​3})?::​(?:​[a-f0-9]{1,​4}(?::​[a-f0-9]{1,​4}){0,​3}:​)?​)))?​(?:​(?:​25[0-5])|(?:​2[0-4][0-9])|(?:​1[0-9]{2})|(?:​[1-9]?​[0-9]))(?:​\.(?:​(?:​25[0-5])|(?:​2[0-4][0-9])|(?:​1[0-9]{2})|(?:​[1-9]?​[0-9]))){3}))\]))$/​iD
 +</​code>​
 +
 +===== Implementieren in den verschiedenen Programmiersprachen =====
 +
 +FIXME
 +
 +==== Python ====
 +
 +==== PHP ====
 +
 +==== GWT/JSP/... ====
 +
 +
 +
 +
 +
 +
 +
 +
  
emailregexp.txt · Last modified: 2011/05/27 12:08 by brot
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0