That depends on what other comments you have in your firewall rules.
When there are no other comments with ddns in them you can use: [find comment~“ddns_”]
But of course that will fail when there is also a ddns_3 or extra_ddns_2 or something like that.
This works fine.
I have only two rules with comments ddns_1 and ddns_2. I have tested with additional ddns_3 and it also works.
Now I see that there is good reference in Scripting - RouterOS - MikroTik Documentation which I’ll check also.
Of course with “fail” I meant that “if ddns_3 exists it will enable that as well” while maybe you wanted only to enable ddns_1 and ddns_2.
So it depends on what you want if the solution works.
It is possible to make it match only ddns_1 and ddns_2 but that would make it more complicated, like “^ddns_[12]”