quasilyte / phpgrep

Syntax-aware grep for PHP code.
MIT License
236 stars 10 forks source link

[${"*"}, $_] doesn't match [1, 2] #63

Closed quasilyte closed 3 years ago

quasilyte commented 3 years ago
$ cat test.php
<?php
var_dump([]);
var_dump([1]);
var_dump([1, 2]);
var_dump([1,]);
var_dump([1,2,]);
$ phpgrep ./test.php '[${"*"}, $_]'
./test/php:4: [1]
found 1 matches

Expected 2 matches.

quasilyte commented 3 years ago

It looks like we need backtracking here as well.