There is a text:
OK
^RSSI: 25
^HCSQ: "LTE",59,52,156,28
It is necessary here to catch the presence of a full line “OK”
The regular message does not work out as I need it:
{
:local str "OK\r\n^RSSI: 25\r\n^HCSQ: \"LTE\",59,52,156,28"
:if ($str~"^OK\$" = true) do={
:put "YES"
} else={
:put "NO"
}
}
Is it possible to specify modifiers globally or locally in the ROS syntax? What would the search be line by line?
This is likely your only chance:
$str~"^OK(\r|\n|\r\n|\$)"
The ROS regex engine (whatever it is) doesn’t seem to support any the “(?m)” flag.
Jotne
3
Since there are lots of or and it only match the \r\n
This could be used as well
$str~"^OK\r\n"
But it depends on your real input as well.
thanks, “OK” can be anywhere. It is also believed that the modems return the newline as “\r\n”
did this:
~"(^|\n)OK(\$|\r)"
.
But, the case-insensitive modifier is no longer missing(?i)
It’s a shame that things like this are not supported.