Migrated all the regex code to the Drupal companion module.