improve regex

start matching with 'function'
fix not accepting & before function name