| | The regular expression syntax allows a variety of syntaxes to be used when matching variable name references, such as: |
| | |
| | -* `(\\${(.*?)})` - matches `${...}` |
| | -* `({{(.*?)}})` - matches `{{...}}` |
| | +* `(\$(.*?)\$)` - matches `$...$` |
| | +* `(\$\{(.*?)\})` - matches `${...}` |
| | |
| | The open and closing parentheses---`(` and `)`---are mandatory. The `?` indicates a non-greedy match. Without the `?`, multiple variable references would not match. For example, `name: $var.1$ $var.2$` would be treated as a variable named `var.1$ $var.2` instead of two distinct variables `var.1` and `var.2`. |
| | + |
| | +Wrap the regular expression in single quotes when running the command, such as: |
| | + |
| | + java -jar $HOME/bin/yamlp.jar --regex '(\$(.*?)\$)' < variables.yaml |
| | + java -jar $HOME/bin/yamlp.jar --regex '(\$\{(.*?)\})' < variables.yaml |
| | + |
| | + |
| | +The single quote prevents the shell from expanding the regex argument into a list of file names. |
| | |
| | # Errors |