Skip to content

Commit ef9e80d

Browse files
committed
add regex for empty variable syntax.
1 parent 34242ff commit ef9e80d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/src/api/regexes.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ final RegExp variablePathComposingRegex = RegExp(variablePathComposingPattern);
125125
/// wrapped in ${} curly braces.
126126
const String variableSyntaxIdentifierPattern = r'\${(?<value>.+)}';
127127

128+
/// A regex that can match empty ${} syntax with partial match for curly braces.
129+
const String emptyVariableSyntaxIdentifierPattern = r'\${?}?';
130+
131+
/// Regex for [emptyVariableSyntaxIdentifierPattern].
132+
final RegExp emptyVariableSyntaxIdentifierRegex =
133+
RegExp(emptyVariableSyntaxIdentifierPattern);
134+
128135
/// Regex for [variableSyntaxIdentifierPattern].
129136
final RegExp variableSyntaxIdentifierRegex =
130137
RegExp(variableSyntaxIdentifierPattern);

0 commit comments

Comments
 (0)