fork from https://github.com/bkiers/PCREParser