Skip to content

Commit 65cc83b

Browse files
committed
#1164 fixing regex for only and contains
1 parent b8632af commit 65cc83b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Diff for: lib/util/utils.dart

+5-6
Original file line numberDiff line numberDiff line change
@@ -621,12 +621,11 @@ class Utils {
621621
return int.tryParse(value);
622622
}
623623

624-
static final onlyExpression = RegExp(
625-
r'''^\${([a-z_-\d\s.,:?!$@&|<>\+/*|%^="'\(\)\[\]]+)}$''',
626-
caseSensitive: false);
627-
static final containExpression = RegExp(
628-
r'''\${([a-z_-\d\s.,:?!$@&|<>\+/*|%^="'\(\)\[\]]+)}''',
629-
caseSensitive: false);
624+
static final onlyExpression =
625+
RegExp(r'''^\$\{([^}]+)\}$''', caseSensitive: false);
626+
627+
static final containExpression =
628+
RegExp(r'''\$\{([^}{]+(?:\{[^}{]*\}[^}{]*)*)\}''', caseSensitive: false);
630629

631630
static final i18nExpression = RegExp(r'\br@([\w\.]+)', caseSensitive: false);
632631

0 commit comments

Comments
 (0)