정규식 패턴에 대한 설명을 생성하는 두 개의 웹 사이트가 있습니다.
^ # anchor the pattern to the beginning of the string; this ensures that
# there are no undesired characters before the email address, as regex
# matches might well be substrings otherwise
( # starts a group (which is unnecessary and incurs overhead)
[\w!.%+\-]
# matches a letter, digit, underscore or one of the explicitly mentioned
# characters (note that the backslash is used to escape the hyphen
# although that is not required if the hyphen is the last character)
)+ # end group; repeat one or more times
@ # match a literal @
( # starts another group (again unnecessary and incurs overhead)
[\w\-] # match a letter, digit, underscore or hyphen
)+ # end group; repeat one or more times
(?: # starts a non-capturing group (this one is necessary and, because
# capturing is suppressed, this one does not incur any overhead)
\. # match a literal period
[\w\-] # match a letter, digit, underscore or hyphen
+ # one or more of those
)+ # end group; repeat one or more times
$ # anchor the pattern to the end of the string; analogously to^
그래서, 이것은 약간의 최적화 된 버전을 다음과 같습니다
패턴에 대한 내 자신의 설명이되어 있으므로 그래픽 않는 단어
regexper.com의 패턴을 설명 : /^[\w!.%+\-][email protected][\w\-]+(?:\.[\w\-]+)+$/
다음은 정규식 패턴에 대한 더 유용한 설명을 생성하는 두 개의 웹 사이트입니다. http://www.regexper.com/ 및 http://regex101.com/ –
감사합니다! 그거야. 그 내용을 답으로 쓰고 싶으면 받아 들여서 기쁩니다. – user