Factor out dependencyInfo RegExp/string toggling.