dontknowhy
dontknowhy

Reputation: 2866

Firestore Security Rules, Regex, how to avoid special chracters

https://firebase.google.com/docs/reference/security/database/regex

I`m looking at this right now and feel kinda hard to understand and tricky

I just want to set regex "only allows lower alphabet and numbers and - _ * # . these five special characters.

how could I acheive that ? thanks

Upvotes: 1

Views: 422

Answers (1)

Renaud Tarnec
Renaud Tarnec

Reputation: 83093

If you use Cloud Firestore you should declare your regular expressions according to Google RE2 syntax, see the doc about the matches() method.

The link you mention in your question is about the Realtime Database Security rules. The Realtime Database and Cloud Firestore are two different NoSQL Database services with different security rules syntax.

Upvotes: 3

Related Questions