Drupal is a registered trademark of Dries Buytaert
File Entity (fieldable files) 8.x-2.7 Minor update available for module file_entity (8.x-2.7). Field Group 4.1.0-alpha4 New alpha version released for module field_group (4.1.0-alpha4). CKEditor 5 Plugin Pack 1.5.4 Minor update available for module ckeditor5_plugin_pack (1.5.4). CKEditor 5 Premium Features 1.8.3 Minor update available for module ckeditor5_premium_features (1.8.3). Themespace 4.0.0 Major update available for module themespace (4.0.0). Recombee 2.0.7 Minor update available for module recombee (2.0.7). Varbase Editor 10.1.6 Minor update available for module varbase_editor (10.1.6). MCP Sentinel 2.0.0 Major update available for module mcp_sentinel (2.0.0). Session Limit Module session_limit crossed 1,000 active installs. Configuration development 8.x-1.12 Module config_devel updated after 8 months of inactivity (8.x-1.12).

Custom filter

784 sites Security covered
View on drupal.org

This module allows you to create custom text filters using regular expressions. You can define your own filters to perform tasks like replacing text, creating custom tags, or even using PHP code for more advanced manipulations.

Overview

This module allows you to create content filter using regular expressions. Instead of creating a new module for each filter you need, now you can easily create and organize your own filters. Your filter will appear in the input format configuration page.

For a description of the regular expression syntax, see PCRE regex syntax; for a description of the modifiers, see Possible modifiers in regex patterns. If you know the syntax used by Perl regular expressions, see Differences From Perl.

Please read thedocumentation where you can see some examples of how to use the module.

Features

Instead of creating a new filter module for every filter you need, you can use this module for tasks like creating your own tags, replacing token values and all changes you need in the text.
You can use simple replacements or use php code to write more powerfull things(like use it to highligth code with geshi).

Supported versions

- The 2.0.x works Drupal 8 and Drupal 9.
- The 3.0.x works with Drupal 11. I will remove support for earlier versions.

Other notes

Because the strings used for the description and the help text of the custom filters are dynamic (i.e., taken from a database table), it is not possible to translate them through t().
There is a possible issue with preg_replace_callback() function used in this module. The default setting for memory is sometimes low, and it return an empty page, look at this issue(Empty body: preg_replace_callback() used on large textfields (like node body) will likely result in NULL return).

Activity

Total releases
1
First release
Apr 2026
Latest release
2 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
3.0.0-beta1 Pre-release Apr 30, 2026