本文介绍了帮助正则表达式。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我为一个电子邮件字段设置了以下regEx模式,我需要允许连字符(' - ')。这意味着电子邮件字段应允许 - 以及所有其他限制。以下是已定义的正则表达式: / ^((([az] | \d | [_] | [\ u00A0 -\\\\\\豈-\\\﷏\\\ﷰ-\\\])+(\([AZ] |。\d | [_] | [\\\ -\\\\\\豈- \\\﷏\\\ﷰ-\\\])+)*)|((\x22)((((\x20 | \x09)*(\x0d\x0a))?(\x20 | \x09)+)(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f] |?\x21 | [\x23-\x5b] | [\x5d-\x7e] | [\\\ -\\\\\\豈-\\\﷏\\\ﷰ-\\\])|(\\([\x01-\x09\\ \\x0b\x0c\x0d-\x7f] | [\\\ -\\\\\\豈-\\\﷏\\\ﷰ-\\\]))))*(((\x20 | \\ \\x09)*(\x0d\x0a))(\x20 |?\x09)+)(\x22)))@((([AZ] |?\d | [\\\ - \\\\\\豈-\\\﷏\\\ﷰ-\\\])|(([AZ] | \d | [\\\ -\\\\\\豈-\\\﷏\\\ﷰ-\\ \])([AZ] | \d | - |。\ | _ |〜| [\u00A 0-\\\\\\豈-\\\﷏\\\ﷰ-\\\])*([AZ] | \d | [\\\ -\\\\\\豈-\\\﷏\\\ﷰ- \\\])))\)+(([AZ] | [\\\ -\\\\\\豈-\\\﷏\\\ﷰ-\\\])|(([AZ] | [ \\\ -\\\\\\豈-\\\﷏\\\ﷰ-\\\])([AZ] | \d | - |。\ | _ |〜| [\\\ -\\\ \\\豈-\\\﷏\\\ﷰ-\\\])*([AZ] | [\\\ -\\\\\\豈-\\\﷏\\\ﷰ-\\\])))\ 。$ $ / i 我的尝试: 因为这太复杂了,我无法理解并解决这个问题。我试了很多东西,把连字符放在很多地方,但是没有成功。你能帮忙吗?解决方案 Hi,I have the following regEx pattern placed for one Email field, I need to allow hyphen ('-') in the same. That means that the email field should allow '-' along with all the other restrictions. Following is the regex already defined:/^((([a-z]|\d|[_]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[_]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/iWhat I have tried:As this is too complex, i couldn't comprehend and fix this. I tried a lot of stuff, putting hyphen at a lot of places, however didnt succeed. Can you help? 解决方案 这篇关于帮助正则表达式。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 阿里云证书,YYDS! 05-21 15:04