eworm-de / routeros-scripts

a collection of scripts for MikroTik RouterOS
GNU General Public License v3.0
1.27k stars 285 forks source link

Update check-routeros-update.rsc #45

Closed bharrisau closed 1 year ago

bharrisau commented 1 year ago

Neighbour version can have a date suffix. This changes to match only on the benginning.

eworm-de commented 1 year ago

Good catch! Any idea when this changed and the suffix was added?

Anyway... I would like to make the match a bit more specific. Are you ok with ceb7b9ce5a38b9efb315ddd48ee14f9e14b5fcfb? This makes sure the match starts at the beginning (^) and some characters are escaped by a function to make sure they have no special meaning (for example (, ) which were ok in your code, and . for any character).

bharrisau commented 1 year ago

No sorry, first update in like 6 months. That doesn't have the .* at the end, but I don't know how routeros does the string matching, so if it doesn't require matching the whole string it will be fine.

eworm-de commented 1 year ago

Regular expressions need to match the start (^) and end ($) of a string explicitly. So matching of .* (any number of any character) is not required at the end unless you match for the end of the string, with something like .*$.

eworm-de commented 1 year ago

Merged into main. Thanks!