File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,10 +64,10 @@ def initialize(*args)
6464 # If at least one special char is used, string must be quoted
6565
6666 # 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 )
6868 user_part = matches [ 2 ]
6969 host_part = matches [ 3 ]
70- elsif matches = /^([0-9a-zA-Z$_]+ )@([\w %\. :]+)$ / . match ( value )
70+ elsif matches = /^([0-9a-zA-Z$_]* )@([\w %\. :\- ]+)/ . match ( value )
7171 user_part = matches [ 1 ]
7272 host_part = matches [ 2 ]
7373 elsif matches = /^(?:(?!['`"]).*)([^0-9a-zA-Z$_]).*@.+$/ . match ( value )
Original file line number Diff line number Diff line change 1313 # If at least one special char is used, string must be quoted
1414
1515 # 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 )
1717 user_part = matches [ 2 ]
1818 host_part = matches [ 3 ]
19- elsif matches = /^([0-9a-zA-Z$_]+ )@([\w %\. :]+)$ / . match ( value )
19+ elsif matches = /^([0-9a-zA-Z$_]* )@([\w %\. :\- ]+)/ . match ( value )
2020 user_part = matches [ 1 ]
2121 host_part = matches [ 2 ]
2222 elsif matches = /^(?:(?!['`"]).*)([^0-9a-zA-Z$_]).*@.+$/ . match ( value )
3030 end
3131
3232 munge do |value |
33- matches = /^((['`"]?).+ \2 )@([\w %\. :]+)$ / . match ( value )
33+ matches = /^((['`"]?).* \2 )@([\w %\. :\- ]+)/ . match ( value )
3434 "#{ matches [ 1 ] } @#{ matches [ 3 ] . downcase } "
3535 end
3636 end
You can’t perform that action at this time.
0 commit comments