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
Right now in extended tests we simply read a word after =~. This works most of the time, but it can be broken with some forms of ERE, by using characters that would otherwise be tokens (like () or spaces.
[[ foo =~ bar(a) ]]
[[ foo =~ ba[ r] ]]
The text was updated successfully, but these errors were encountered:
What we're doing now (after the commit above) is read until we find ]]. This will work most of the time, but will break if a tab is used instead of a space, or if the regex itself contains ]].
$ echo '[[ a =~ ( ]]) ]]' | bash
$ echo '[[ a =~ ( ]]) ]]' | shfmt
1:13: statements must be separated by &, ; or a newline
mvdan
changed the title
parser: full support for a regexp following =~
syntax: full support for a regexp following =~
Oct 30, 2016
Right now in extended tests we simply read a word after
=~
. This works most of the time, but it can be broken with some forms of ERE, by using characters that would otherwise be tokens (like(
) or spaces.The text was updated successfully, but these errors were encountered: