Is it possible to disallow or replace certain characters in string with Firebase Realtime Database Security Rules?
For example disallow the "<" character?
Or replace the "<" with ">" character?
>Solution :
Yes, this is definitely possible with Firebase Realtime Database security rules.
You can use the .validate rule to specify a regex pattern that data must match. For your specific examples, you could do:
Disallow <: .validate(!newData.hasChildren() && !newData.val().matches('<'))
Replace < with >: .validate(!newData.hasChildren() && newData.val().replace('<', '>').matches('[your-regex-here]'))
The !newData.hasChildren() condition is included above to prevent the rule from being bypassed by writing nested data.