Open ComLock opened 4 years ago
According to the code intention was to support some sort of glob syntax or even less.
.
- means only dot
*
- matches any number of any characters including none
so prefix.*
matches anything that starts with prefix.
and first.second
matches only first.second
and nothing more
Everything else that "works" now but should not - I would consider a bug.
So the parentheses and pipe char to signify groups and alternatives should not work then? Seems more like a nice magic feature to me :)
Indeed. Magic.
For your use-case create two listeners: node.*
and task.*
In case you are not interested in node.push
, filter it out in listener itself.
If you really
want magic, subscribe to *
and do a filtering in js code. It may be even more optimal for overall system throughput.
Well that's good to know. My assumption was that the API would be more optimised than each developers own code.
ref: https://developer.enonic.com/docs/xp/stable/api/lib-event#listener
It's not RegExp, but similar
WRONG '(node.(created|updated|deleted)|task..*)'
RIGHT '(node.(created|updated|deleted)|task.*)'
So a dot, simply means a dot, not any char like in regexp. And a asterix means wildcard. Uncertain wether it means anything, 0 or more times.