Need more documents for regexp at /routing/filter/community-list

I’m trying to use community-list to filter routes or modify certain communities, but it’s really hard to achieve using regexp.

The help page didn’t include any examples for this, so I had to test it on my own, encountering numerous failures along the way. For example:

  1. Adding regexp items in Winbox fails:
  • I can’t add new items via Winbox with type=regexp.
  • No matter what I enter in the “Regexp” box, from regex patterns tested successfully on regex101.com to empty string, RouterOS always returns “invalid regexp”.
  1. Adding regexp items behaves strangely:
  • I can add new items via the console with type=regexp, but the content of “regexp” displays differently in Winbox versus the console (what the heck?).
  • After adding a regexp item via the console, I can modify the “regexp” content in Winbox without triggering the “invalid regexp” error.
  1. Inconsistent behavior when applying the list in filtering rules:
  • The list works for matching routes but fails to delete communities.
  • Here are the two community lists I configured:

`/routing filter community-list

add list=dn42_connection_info_regex regexp=“64511\:\d”

add list=dn42_connection_info communities=“64511:1,64511:2,64511:3,64511:4,64511:5,64511:6,64511:7,64511:8,64511:9,64511:10,64511:11,64511:12,64511:13,64511:14,64511:15,64511:16,64511:17,64511:18,64511:19,64511:20,64511:21,64511:22,64511:23,64511:24,64511:25,64511:26,64511:27,64511:28,64511:29,64511:30,64511:31,64511:32,64511:33,64511:34,64511:35”`

  1. Testing filtering rules:
    (Note: In Winbox, the regexp is set to "64511\:[\d|[1-3][0-9]]".)
  • if (bgp-communities any-list dn42_connection_info_regex) { delete bgp-communities dn42_connection_info_regex; accept; }
    → Matches correctly, but deletion fails.

  • if (bgp-communities any-list dn42_connection_info) { delete bgp-communities dn42_connection_info_regex; accept; }
    → Matches correctly, but deletion fails.

  • if (bgp-communities any-list dn42_connection_info_regex) { delete bgp-communities dn42_connection_info; accept; }
    → Matches correctly, deletion succeeds.

  • if (bgp-communities any-list dn42_connection_info) { delete bgp-communities dn42_connection_info; accept; }
    → Matches correctly, deletion succeeds.

Regexp is incredibly useful for configuration and offers great flexibility. I hope there will be more documentation and examples on how to properly configure it for route filtering.


  1. Winbox problem confirmed.

  2. For CLI strings special characters need to be escaped:
    Scripting - RouterOS - MikroTik Documentation

  3. As stated in the documentation. community list entry with just a regexp parameter is used only for matching.

  1. Typing in CLI should be add list=dn42_connection_info_regex regexp=“64511\\:\\d”, the codes I’ve pasted are copied from export. But the real problem is that content in CLI/export is different from content shown in winbox.

  2. I’ve also tried using regex directly in filter rule like delete bgp-communities regexp "64511\:[\d|[1-3][0-9]]"; , but still not working.


I’ve read the document, but it just noticed that regex can not using to append. So I think it means that deletion or filtering should works. If only matching is supported, how about changing the description?