これは、@記号の前に2文字以上の文字を入力する必要はありません。
^[a-zA-Z][a-zA-Z0-9]*(?:\.+[a-zA-Z0-9]+)*@domain\.com$
ここでそれが壊れる方法は次のとおりです。dan08 @
^ Make sure we start at the beginning of the string
[a-zA-Z] First character needs to be a letter
[a-zA-Z0-9]* ...possibly followed by any number of letters or numbers.
(?: Start a non-capturing group
\.+ Match any periods...
[a-zA-Z0-9]+ ...followed by at least one letter or number
)* The whole group can appear zero or more times, to
offset the + quantifiers inside. Otherwise the
period would be required
@domain\.com$ Match the rest of the string. At this point, the
only periods we've allowed are followed by at
least one number or letter
ない、それは角括弧だ場合 - それはその特別な意味を失います。 – vlaz
本当に!それを知らなかった。コメントは取り消されました。 – dan08
@ dan08ええ - ほとんどの文字は角括弧で特別な意味を失います。最も顕著なのは '[]'(まだそれらをエスケープする必要がある)だけでなく、文字範囲を示す ' - 'です。ただし、最初または最後に配置すると、ダッシュとして扱われます。 – vlaz