mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-02-20 23:29:34 +00:00
global-functions: $Grep: use length from variable
This commit is contained in:
parent
0ba5c9f63e
commit
1af9ed26b7
1 changed files with 3 additions and 2 deletions
|
|
@ -728,11 +728,12 @@
|
||||||
:do {
|
:do {
|
||||||
# Do *NOT* try :deserialize here to split lines. It can fail with
|
# Do *NOT* try :deserialize here to split lines. It can fail with
|
||||||
# scripts, and it *does* fail with global-functions!
|
# scripts, and it *does* fail with global-functions!
|
||||||
:local Line [ :pick $Input 0 [ :find $Input "\n" ] ];
|
:local Len [ :find $Input "\n" ];
|
||||||
|
:local Line [ :pick $Input 0 $Len ];
|
||||||
:if ([ :typeof [ :find $Line $Pattern ] ] = "num") do={
|
:if ([ :typeof [ :find $Line $Pattern ] ] = "num") do={
|
||||||
:return $Line;
|
:return $Line;
|
||||||
}
|
}
|
||||||
:set Input [ :pick $Input ([ :find $Input "\n" ] + 1) [ :len $Input ] ];
|
:set Input [ :pick $Input ($Len + 1) [ :len $Input ] ];
|
||||||
} while=([ :len $Input ] > 0);
|
} while=([ :len $Input ] > 0);
|
||||||
|
|
||||||
:return [];
|
:return [];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue