I’m trying to configure a CalDav item to only match a specific RegEx. I confirmed that the actual regex is correct. The doc says:
How should I enter my Regular Expression?
Just entering filter-name:‘Regular Expression here’ seems to match everything. Entering like filter-name=’\Regular Expression here’ gives an error upon loading.
How should I use regex in the caldav configuration?
Events in my calendar are not multiline and I think the first group has the value.
But I will try to be more specific, maybe you can help.
The regex I have:
So I want to filter the events which start with ‘szállás’ (or with an uppercase - I know that there are flags also for this, but I don’t know if it works in OH or not) or has the word ‘Hotel’ in the event name.
It gives a ‘Full match’ for me on a regex tester like this:
Or maybe I just need to add braces for this regex like this:
This is what I haven’t tried yet. This way it also returns the 1st Group in every Regex tester.
Like I said, the regular expression must match the full string. That regular expression will only match one word. I doubt your calendar entry is just one word so you need to have the regular expression match everything after that first word too.
@rkrisi, did you ever get this working? I just had a go with some Items and figured out a few… nuances of this binding. The binding is using regex to extract the regex for the filter-name. When you use anything other than what is in the allowed character set, the matching stops. Your filter expression cannot contain anything other than A-Z, a-z, ., *, +, -, |, and spaces. You are using special characters, which will stop the matching. Character sets will also stop the matching due to the [. If the matching stops before the end, nothing will be found. However, if the matching stops at the very beginning, like when ^ is used, then there is effectively no filter and everything is returned. Hopefully some of this makes sense! The documentation definitely needs an update.