We rebuilt our website from scratch and are still updating some extensions and pages. Having a problem? Sign in and open a support ticket or contact us.
JoomBoost

Regex Replacer

The Regex Replacer replaces or removes every part of a field that matches a regular expression. Use it to remove "Read more" lines, tracking links, ads, or to fix the HTML of a source.

Input and output

  • Input: input, any text or HTML field.
  • Output: result.

Options

  • Regex Pattern: a PHP (PCRE) regular expression, with delimiters, such as /Read more.*$/i.
  • Replacement Value: what replaces each match. Leave empty to remove it. Use $1, $2 for the parts captured in brackets.

Examples

You want Regex Pattern Replacement Value
Remove a sentence /<p>The post .*? appeared first on .*?<\/p>/is (empty)
Remove all links but keep their text /<a[^>]*>(.*?)<\/a>/is $1
Use lazy-loaded image addresses /data-src=/i src=
Remove empty paragraphs /<p>(\s\|&nbsp;)*<\/p>/i (empty)
Turn line breaks into paragraphs /\n{2,}/ </p><p>

Tips

  • The s flag lets . match line breaks, i ignores case, U makes the quantifiers lazy.
  • Escape / inside the pattern as \/, or use another delimiter such as #...#.
  • Test the pattern on a site such as regex101.com with the PCRE flavour before you add it.
  • Add one Regex Replacer for each pattern, and pass each result to the next one.

All Extensions