Script uses asterisk in regex as if it were a shell glob. In regex, asterisk means zero or more of the preceding character. To match string prefixes, use '^' for start-of-line instead.