您好我正在使用正则表达式来验证电子邮件,但是当我尝试在电子邮件地址中使用下划线而不是给我错误时。
以下是我正在使用的regx。
^ [A-ZA-Z0-9 - '+〜] +([A-ZA-Z0-9 - ' +〜] +)* @([A-ZA-Z_0-9 - ] +。 )+ [A-ZA-Z] {2,10} $
#1 Set Credentials Button
$Set_Credential = New-Object System.Windows.Forms.Button
$Set_Credential.Top = "5"
$Set_Credential.Left = "5"
$Set_Credential.Anchor = "Left,Top"
$Set_Credential.Text = 'Set Credentials'
$Set_Credential.add_Click({
$UserCredential = Get-Credential
})
$Exchange_Manager.Controls.Add($Set_Credential)
#3 Connect to Exchange Online
$Exchange_Connect = New-Object System.Windows.Forms.Button
$Exchange_Connect.Top = "5"
$Exchange_Connect.Left = "150"
$Exchange_Connect.Anchor ="Left,Top"
$Exchange_Connect.Text = 'Connect'
$Exchange_Connect.add_Click({
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential "$UserCredential" -Authentication Basic -AllowRedirection
Import-PSSession $Session
})
$Exchange_Manager.Controls.Add($Exchange_Connect)
任何人都可以告诉我应该使用哪个regx?