Regex Text Replacement
89 sites
Security covered
Drupal 9–11
This module adds a filter to text formats that allows for complex text replacements using regular expressions. It can be used to automate the modification of content based on defined patterns and their replacements.
Adds a filter that can be applied to text formats to make complex replacements.
Requirements
This module requires no modules outside of Drupal core.
Installation
Install as you would normally install a contributed Drupal module. For further
information, see Installing Drupal Modules.
Configuration
- Visit your text formats and editors at admin/config/content/formats
- Edit a text format
- Add the Regex Text Replacement filter. For example, the following will replace h2 tags with h3...
/<h[1|2]([^>]*)>(.*?)<\/h[1|2][^>]*>/mi||<h3(1)>(2)</h3>
Depends on
Dependencies of the latest stable release
- filter Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.