Revert "Use parser flags instead of regexp matching"

This reverts commit 622523de4108130a32b0aff1af3da7c2cda98329.

We don't have flags always available...
Add some missing includes