Enabled filters for CKEditor pattern replace module
Filter settings for CKEditor pattern replace module

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}

Project information

Releases