Skip to content

Regex replace

Replaces every part of the value that matches a regular expression (a search pattern).

Group: Text

Keep the first image of a comma-separated list, reorder parts of a value, remove anything between brackets.

  • Regular expression: the pattern to find.
  • Replace with: the new text. $1, $2… reuse the parts in parentheses, $& the whole match.
  • Case sensitive: off by default.
Before After
a.jpg, b.jpg, c.jpg a.jpg (pattern \s*,.*$, replace with nothing)
10x20 20 by 10 (pattern (\d+)x(\d+), replace with $2 by $1)
  • Patterns use the RE2 syntax, which has no lookaround or backreferences. A pattern that is not valid is refused when you save, with the reason.
  • For a fixed piece of text, Replacement is simpler.