0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Exchange Onlineでメールアドレスのパターンマッチで先頭にワイルドカードを入れる

0
Posted at

^.*@example.com$のようなパターンは対応していない

こんなパターンを使うと
^.*@example.com$
こんな感じのエラーが出てしまう。

Error executing cmdlet:
|System.ArgumentException|The specified regular expression '^.\.@example.com$' is invalid.
"You cannot configure a pattern that begins with a wildcard like (.
, .+, .{0,n} or .{1,n}). You must remove the wildcard from the beginning of the pattern to continue." (Parameter 'RecipientAddressMatchesPatterns')
Exception of type 'Microsoft.Exchange.Management.PSDirectInvoke.DirectInvokeCmdletExecutionException' was thrown.

実は\SならOK

^\S*@example.com$ ^\S*.user@example.com$のような感じで書ける。
\Sは空白以外の単一文字と一致するので、仕様的にはむしろ適切。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?