Skip to content

Commit d472682

Browse files
committed
docs modify: Add example for double-escaping in JSON
1 parent 3ec7a5a commit d472682

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

docs/user/bots.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3265,6 +3265,7 @@ One configuration file can contain an arbitrary number of rules.
32653265
* **Empty string**: If the value for a condition is an empty string, the bot checks if the field does not exist. This is useful to apply default values for empty fields.
32663266
* A non-empty **string**: The matching uses [regular expressions](https://docs.python.org/3/library/re.html#re.search) to match the field. Use explicit beginning and end markers to match the full string instead of a substring: `^regex$`.
32673267
If the field is not a string, it will be converted to a string first. This allows for matching numeric values with regular expressions.
3268+
To escape a character in the regular expression, JSON requires you to double-escape, for example, in `"extra.version": "^10\\.0"` the `.` is matched as literal character.
32683269
* All **other types**: boolean, integer, float, etc: Direct equality comparison
32693270

32703271
To check for the existence of a field, you can therefore always use the condition `"."`.

0 commit comments

Comments
 (0)