Text replacements

Replace X with Y, cut everything after a phrase, strip links, hashtags, mentions and emoji.

Text replacements rewrite the post text before it is delivered. The section exists in the chat settings and in every source, with the Replace / Add to mode switch for sources.

Available from the Pro plan.

Base replacements

Five switches cover the common cleanups:

  • Remove links — strip URLs from the text. Once it is on, a second choice appears: Link only or With its text. In Routify both currently work the same: the link is removed and its caption stays as plain text.
  • Remove hashtags — strip #tags.
  • Remove mentions — strip @mentions.
  • Remove emoji — strip emoji, premium ones included.
  • Remove "subscribe" links — Routify-only: lines like "Subscribe", "We are on MAX" or "Read in subscription" go away; a link to the source itself stays.

Whitespace is tidied after them: runs of spaces collapse into one and more than two empty lines in a row become two.

Replacement rules

Replacement rules opens the list of your own rules. A rule has the text to find, the text to put instead (leave it empty to delete the match) and match options:

  • Partial or Word — replace any occurrence anywhere in the text, including inside words, or only whole words. Whole-word matching works on any alphabet, Cyrillic included.
  • Case-insensitive — BBC, bbc and Bbc are treated the same.
  • regexp — a toggle next to the field, not a third match option: once it is on, the "find" field is a JavaScript pattern, capture groups can be used in the replacement as $1, $2, and the field offers a ? cheat sheet and a ▶ button that tests the pattern against sample text right there, before you save the rule.
  • Cut after match — delete everything from the match to the end of the text. Handy for signatures and "Read more" tails.
  • Match visible text — look at the text as a reader sees it, ignoring bold, italics, links and other formatting in between; useful for a phrase that is only ever posted as a styled link or made partly italic. Not available together with regexp.

A trailing @cut, @word, @case or @visible typed at the end of the "replace with" field in the form is read as a shortcut for the matching option it names — the same modifiers the text format below uses.

Rules are shown 10 per page, and a legend at the top shows only the icons your rules use. Tap a rule to edit it. While there are no rules, the add form is open right away; once there are, a new one is added with the Add button under the list. Opening the form closes a rule edit in progress without saving, and the other way round.

Rules run in the order of the list; every rule sees the text as the previous rules left it. The base replacements are applied after your rules.

Examples

FindReplace withOptionsEffect
Subscribe to our channel(empty)Case-insensitiveremoves the call to action
Read the full story(empty)Cut after matchcuts the tail of every post
(\d+) USD$1 dollarsRegular expressionrewrites currency
t.me/othersourcet.me/mychannelPartialswaps the promoted link

Import and export as text

Download replacements / Load from file in the Import and export replacements block, at the bottom of the rules list, move only the replacement rules as a plain-text file — one rule per line, not the whole chat configuration (for that, see Import and export). The format:

# реклама => промо
# Сочи => Sochi @word
# BMW => БМВ @case
# /куп(и|ить)/i => купить
# реклама =>
# Читать далее => @cut
# MAX | VK => @cut @visible

find => replace on a line, modifiers after the replacement; a # at the start comments the line out, so a copied sample does nothing until you remove it. A regex is written between slashes with flags after, as in a rule's own field. Importing shows a preview — how many rules are new, how many duplicate the current list — before anything is written, and you choose whether it merges with the existing rules or replaces them.

Where replacements sit in the pipeline

Replacements run on the final text, after filters, translation and AI — see the pipeline order. Filters have an "after replacements" stage, but in Routify it currently checks the original text, so a stop word cannot catch text that only appears once a rule has rewritten it (see Message filtering).

Checking what was replaced

Replacements are not shown as a step of the history trace. If a post looks wrong, open its row and compare the final text with the source post before editing the rules.

Set up your first forward today

Every post you copy by hand is time the bot could save you. Open the bot, send a public channel’s link and pick where to forward it: the first messages arrive within minutes.

Open @RoutifyBot