File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -64,10 +64,10 @@ def initialize(*args)
64
64
# If at least one special char is used, string must be quoted
65
65
66
66
# http://stackoverflow.com/questions/8055727/negating-a-backreference-in-regular-expressions/8057827#8057827
67
- if matches = /^(['`"])((?!\1 ).)+ \1 @([\w %\. :]+)$ / . match ( value )
67
+ if matches = /^(['`"])((?!\1 ).)* \1 @([\w %\. :\- ]+)/ . match ( value )
68
68
user_part = matches [ 2 ]
69
69
host_part = matches [ 3 ]
70
- elsif matches = /^([0-9a-zA-Z$_]+ )@([\w %\. :]+)$ / . match ( value )
70
+ elsif matches = /^([0-9a-zA-Z$_]* )@([\w %\. :\- ]+)/ . match ( value )
71
71
user_part = matches [ 1 ]
72
72
host_part = matches [ 2 ]
73
73
elsif matches = /^(?:(?!['`"]).*)([^0-9a-zA-Z$_]).*@.+$/ . match ( value )
Original file line number Diff line number Diff line change 13
13
# If at least one special char is used, string must be quoted
14
14
15
15
# http://stackoverflow.com/questions/8055727/negating-a-backreference-in-regular-expressions/8057827#8057827
16
- if matches = /^(['`"])((?:(?!\1 ).)+ )\1 @([\w %\. :]+)$ / . match ( value )
16
+ if matches = /^(['`"])((?:(?!\1 ).)* )\1 @([\w %\. :\- ]+)/ . match ( value )
17
17
user_part = matches [ 2 ]
18
18
host_part = matches [ 3 ]
19
- elsif matches = /^([0-9a-zA-Z$_]+ )@([\w %\. :]+)$ / . match ( value )
19
+ elsif matches = /^([0-9a-zA-Z$_]* )@([\w %\. :\- ]+)/ . match ( value )
20
20
user_part = matches [ 1 ]
21
21
host_part = matches [ 2 ]
22
22
elsif matches = /^(?:(?!['`"]).*)([^0-9a-zA-Z$_]).*@.+$/ . match ( value )
30
30
end
31
31
32
32
munge do |value |
33
- matches = /^((['`"]?).+ \2 )@([\w %\. :]+)$ / . match ( value )
33
+ matches = /^((['`"]?).* \2 )@([\w %\. :\- ]+)/ . match ( value )
34
34
"#{ matches [ 1 ] } @#{ matches [ 3 ] . downcase } "
35
35
end
36
36
end
You can’t perform that action at this time.
0 commit comments