Fixed regex to capture HTTP headers

- Take into account that matches may not exist