1.8.x doesn't support lookbehind; refactor to accomodate, make detectors more forgiving in the process