Add file input and simplify regex