Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试用红色节点拆分以下 llap 消息:
a--A02+1023-
所以我最终得到了“+”号后面的整数。有时有三个数字,最后一个字符带有“-”。例如。a--A02+982--
一旦我有了这个 3 或 4 位数字,我就可以推断出相关的传感器值
我已经用 python 管理了它,但是 node red 的方式对我来说是新的。
非常感谢
通过函数节点传递消息并使用正则表达式
var regExp = /.*\+(\d+)-/; var results = regExp.exec(msg.payload); msg.payload = results[1]; return msg;