Advertisement
Guest User

Untitled

a guest
Oct 20th, 2015
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PCRE 1.73 KB | None | 0 0
  1. /(?(DEFINE)
  2.     (?<addr_spec> (?&local_part) @ (?&domain) )
  3.     (?<local_part> (?&dot_atom) | (?&quoted_string) | (?&obs_local_part) )
  4.     (?<domain> (?&dot_atom) | (?&domain_literal) | (?&obs_domain) )
  5.     (?<domain_literal> (?&CFWS)? \[ (?: (?&FWS)? (?&dtext) )* (?&FWS)? \] (?&CFWS)? )
  6.     (?<dtext> [\x21-\x5a] | [\x5e-\x7e] | (?&obs_dtext) )
  7.     (?<quoted_pair> \\ (?: (?&VCHAR) | (?&WSP) ) | (?&obs_qp) )
  8.     (?<dot_atom> (?&CFWS)? (?&dot_atom_text) (?&CFWS)? )
  9.     (?<dot_atom_text> (?&atext) (?: \. (?&atext) )* )
  10.     (?<atext> [a-zA-Z0-9!#$%&'*+\/=?^_`{|}~-]+ )
  11.     (?<atom> (?&CFWS)? (?&atext) (?&CFWS)? )
  12.     (?<word> (?&atom) | (?&quoted_string) )
  13.     (?<quoted_string> (?&CFWS)? " (?: (?&FWS)? (?&qcontent) )* (?&FWS)? " (?&CFWS)? )
  14.     (?<qcontent> (?&qtext) | (?&quoted_pair) )
  15.     (?<qtext> \x21 | [\x23-\x5b] | [\x5d-\x7e] | (?&obs_qtext) )
  16.     # comments and whitespace
  17.     (?<FWS> (?: (?&WSP)* \r\n )? (?&WSP)+ | (?&obs_FWS) )
  18.     (?<CFWS> (?: (?&FWS)? (?&comment) )+ (?&FWS)? | (?&FWS) )
  19.     (?<comment> \( (?: (?&FWS)? (?&ccontent) )* (?&FWS)? \) )
  20.     (?<ccontent> (?&ctext) | (?&quoted_pair) | (?&comment) )
  21.     (?<ctext> [\x21-\x27] | [\x2a-\x5b] | [\x5d-\x7e] | (?&obs_ctext) )
  22.     # obsolete tokens
  23.     (?<obs_domain> (?&atom) (?: \. (?&atom) )* )
  24.     (?<obs_local_part> (?&word) (?: \. (?&word) )* )
  25.     (?<obs_dtext> (?&obs_NO_WS_CTL) | (?&quoted_pair) )
  26.     (?<obs_qp> \\ (?: \x00 | (?&obs_NO_WS_CTL) | \n | \r ) )
  27.     (?<obs_FWS> (?&WSP)+ (?: \r\n (?&WSP)+ )* )
  28.     (?<obs_ctext> (?&obs_NO_WS_CTL) )
  29.     (?<obs_qtext> (?&obs_NO_WS_CTL) )
  30.     (?<obs_NO_WS_CTL> [\x01-\x08] | \x0b | \x0c | [\x0e-\x1f] | \x7f )
  31.     # character class definitions
  32.     (?<VCHAR> [\x21-\x7E] )
  33.     (?<WSP> [ \t] )
  34. )
  35. ^(?&addr_spec)$/xmg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement