Improved the regex for the header task