· 9 years ago · May 26, 2017, 05:02 PM
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