Advertisement
Guest User

Untitled

a guest
May 26th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.95 KB | None | 0 0
  1.  val userPartRfc2822 = """([A-Za-z0-9+_.-]+)"""
  2.     val userPartRfc2822OrSpace = """([A-Za-z0-9+_.-]+| )"""
  3.     val atInform = """(@informatik.haw-hamburg.de)"""
  4.     val dotUnderscore = """(.|_)"""
  5.     val gmail = """(@gmail.com)"""
  6.     val googlemail = """(@googlemail.com)"""
  7.  
  8.     //  _?_@informatik.haw-hamburg.de
  9.     val firstPattern = (userPartRfc2822OrSpace+dotUnderscore+userPartRfc2822OrSpace+atInform).r
  10.  
  11.     //    _@informatik.haw-hamburg.de
  12.     val secondPattern = (userPartRfc2822+atInform).r
  13.  
  14.     //_#@informatik.haw-hamburg.de
  15.     val thirdPattern = (userPartRfc2822+"""(\d)"""+atInform).r
  16.  
  17.  
  18.     //_._@gmail.com oder _@googlemail.com
  19.     val fourthPattern = (userPartRfc2822OrSpace+"""(\.)"""+userPartRfc2822OrSpace+gmail).r
  20.     val fifthPattern = (userPartRfc2822+googlemail).r
  21.  
  22.     //_._@_.de oder _._@_.com
  23.     val sixthPattern = (userPartRfc2822OrSpace+"""(\.)"""+userPartRfc2822OrSpace+"""(@)"""+userPartRfc2822+"""(\.de|\.com)""").r
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement