I think you do not understand how the template works. It does not correspond to 0 or more characters, it corresponds to 0 or more from the previous atom, which in this case is equal to y
. So the search
/array*=
will match any of them:
arra= array= arrayyyyyyyy=
If you want to match 0 or more characters, use a dot atom that matches any character other than a newline.
/array.*=
If you want something more reliable, I would recommend:
/array\s*\[[^\]]\+\]\s*=
which is an "array" followed by 0 or more spaces, followed by everything in parentheses, followed by 0 or more spaces, and then the equal sign.
source share