corrected implementation of parsing asterisk in regex