You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bundles/org.openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/internal/util/preprocessor/ModelConstructor.java
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -52,24 +52,24 @@ class ModelConstructor extends Constructor {
52
52
* Matches variable interpolation patterns in YAML strings.
53
53
*
54
54
* Supported syntax (subset of bash variable substitution):
55
-
* - ${var} : Simple variable substitution. If 'var' is not set, returns empty string.
56
-
* - ${var-default} : If 'var' is set but empty, returns empty string . If not set, returns 'default'.
57
-
* - ${var:-default} : If 'var' is set but empty, returns 'default'. If not set, returns 'default'.
58
-
* - Default values can be single-quoted, double-quoted, or unquoted.
55
+
* - ${var} : Simple variable substitution. If 'var' is not set, returns empty string.
56
+
* - ${var-default} : If 'var' is set but empty, returns empty string . If not set, returns 'default'.
57
+
* - ${var:-default} : If 'var' is set but empty, returns 'default'. If not set, returns 'default'.
58
+
* - Default values can be single-quoted, double-quoted, or unquoted.
59
59
*
60
60
* Regex breakdown:
61
-
* - (?<name>\\w+) : Captures the variable name (alphanumeric and underscore).
62
-
* - (?<separator>:?-) : Optionally captures the separator (either '-' or ':-').
63
-
* - '(?<defaultsq>[^']*)' : Captures single-quoted default value (inside quotes).
64
-
* - "(?<defaultdq>[^"]*)" : Captures double-quoted default value (inside quotes).
65
-
* - (?<default>[^}]*) : Captures unquoted default value (up to closing brace).
66
-
* - All default value groups are optional.
61
+
* - (?<name>\\w+) : Captures the variable name (alphanumeric and underscore).
62
+
* - (?<separator>:?-) : Optionally captures the separator (either '-' or ':-').
63
+
* - '(?<defaultsq>[^']*)' : Captures single-quoted default value (inside quotes).
64
+
* - "(?<defaultdq>[^"]*)" : Captures double-quoted default value (inside quotes).
65
+
* - (?<default>[^}]*) : Captures unquoted default value (up to closing brace).
66
+
* - All default value groups are optional.
67
67
*
68
68
* Additional notes:
69
-
* - If no default value is provided, an empty string is returned.
70
-
* - Whitespace inside default values is preserved.
71
-
* - Nested variable patterns are not matched by this regex (handled separately).
72
-
* - Invalid patterns (e.g., missing closing brace) will not match.
69
+
* - If no default value is provided, an empty string is returned.
70
+
* - Whitespace inside default values is preserved.
71
+
* - Nested variable patterns are not matched by this regex (handled separately).
72
+
* - Invalid patterns (e.g., missing closing brace) will not match.
Copy file name to clipboardExpand all lines: bundles/org.openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/internal/util/preprocessor/YamlPreprocessor.java
0 commit comments