ByEnclosureAPI: replace regex engine with hacks