Firebase Storage User Base Security DocumentのRE2構文ミス

ユーザーデータを保護する  |  Firebase において

match /public/{imageId} {
  allow read: if resource.size < 100 * 1024;
  allow write: if imageId.matches(".*\.txt");
}

というサンプルがあるがエラーになる。

f:id:yoneapp:20171204180544p:plain

Google RE2の正規表現で「?(ハテナ)」「.」などをエスケープする方法【Data Studio】 - アズメディア|広告とメディアを考える(@_danboooo_ ) を参考に

match /public/{imageId} {
  allow read: if resource.size < 100 * 1024;
  allow write: if imageId.matches(".*\\.txt");
}

と修正すると良さそう。

なお Syntax · google/re2 Wiki · GitHub にSyntaxの説明がある。