Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module allows you to define patterns using regular expressions that will be automatically replaced with specified text within your content. This can be used to moderate content, hide personal data, or standardize text across your site.

The "CKEditor pattern replace" module is designed to provide an option at "Text formats and editors" to filter the pattern using regular expression and replace it with the replacement text.


Try this module on simplytest.me!!

There could be many use cases for pattern replacement, below are a couple of such use cases of this module.

Potential use cases:

Use case I:

As a content moderator, I wish to avoid any foul/abusive words being used on my website.
Solution:

  • Configure the module to replace the pattern of foul/abusive words with some other word or blank(with an empty replacement text).
  • e.g. of configurations:
    • Hiding abusive word with symbols /abusive word/|****
    • Replacing abusive word with a better word /abusive word/|Better word
    • Just remove the abusive word /abusive word/|

Use case II:

As a website owner, I wish to avoid any user's personal data such as phone number, NOT to be displayed as part of any content.
Solution:

  • Configure the module to replace the pattern of phone number with some other number or redirect the user to a page with contact information.
  • e.g. of configurations:
    • Hiding contact number with symbols /(\+\d{1,3}[- ]?)?\d{10}/|####
    • Replacing contact number with the global business number/(\+\d{1,3}[- ]?)?\d{10}/|+11 111 1111
    • Redirect to contact details page/(\+\d{1,3}[- ]?)?\d{10}/|<a href=/contact-us> Contact us </a>
  • Similar to this solution with phone numbers, the solution can be leveraged for personal email Ids with regex as:[\w\.]+@([\w-]+\.)+[\w-]{2,4}

Activity

Total releases
1
First release
Aug 2025
Latest release
11 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Release date
1.2.0 Stable Aug 1, 2025