...and I need to get the wildcard (+) name and the value of the topic. This name hold the name of a sensor and becouse I have loooots of sensors I want to keep it simple and parse them all the same way.
When I attach a debugger to the node, I can see the complete topic, but I just need the wildcard part.
Thanks for the tip! Got as far as splitting some stuff up, but I can't seem to get the regex part right.
If I use a split, I get many messages, and need a way to discard all but the Nth of them.
no don't use a split node.... you need a change node as Julian said.
(or simple function node with msg.payload = msg.topic.split("/")[3]; I think (as you have a leading /
A Change node will be more efficient than a simple function node, as function nodes have a significant inherent overhead. However it is most unlikely that you need to worry about efficiency unless you are trying to handle thousands of messages per second, so do whatever you feel most comfortable with.