protected function stripComments() { // single-line comments $this->registerPattern('/\\/\\/.*$/m', ''); // multi-line comments $this->registerPattern('/\\/\\*.*?\\*\\//s', ''); }