Skip to content

Commit 2ec1ca4

Browse files
committed
Quoting shenanigans
1 parent da69d17 commit 2ec1ca4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doc/dev/api/v1/calls/catalog-diff.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,16 @@ In this case, "owner", "notify", and "content" are nested under "parameters". In
167167

168168
```
169169
# Ignore all changes to the `owner` attribute of a file.
170-
[ { type: Regexp.new('\AFile\z'), attr: Regexp.new("\Aparameters\fowner\z" } ]
170+
[ { type: Regexp.new('\AFile\z'), attr: Regexp.new("\\Aparameters\fowner\\z" } ]
171171
172172
# Ignore changes to `owner` or `group` for a file or an exec.
173-
[ { type: Regexp.new('\A(File|Exec)\z'), attr: Regexp.new("\Aparameters\f(owner|group)\z" } ]
173+
[ { type: Regexp.new('\A(File|Exec)\z'), attr: Regexp.new("\\Aparameters\f(owner|group)\\z" } ]
174174
```
175175

176+
When using regular expressions, `\f` (form feed character) is used to separate the structure (e.g. `parameters\fowner` refers to the `parameters` hash, `owner` key).
177+
178+
:bulb: Note that `\A` in Ruby matches the beginning of the string and `\z` matches the end, but these are not actual characters. Therefore, if you are using `\A` or `\z` in double quotes (`"`), be sure to heed the examples above and write your expression like: `Regexp.new("\\Aparameters\fowner\\z")`.
179+
176180
#### `:validate_references` (Array<String>, Optional)
177181

178182
Invoke the [catalog validation](/doc/advanced-catalog-validation.md) feature to ensure resources targeted by `before`, `notify`, `require`, and/or `subscribe` exist in the catalog. If this parameter is not defined, no reference validation occurs.

0 commit comments

Comments
 (0)