Hi,
I’m using the current 2023.11.3 and try to configure a NAS as external strorage for backup. Unfortunately HA doesn’t accept my configuration because path string is supposedly incorrect. I got:
“does not match regular expression ^[^\\\/]+
for dictionary value @ data[‘share’]. Got ‘/SmartHome/HomeAssistant’”.
I ‘parsed’ the path string in my brain with that regex and think it is correct.
Aditionally I checkt it with an analyze (Regular Expression Analyzer) - same result.
Is there an error there or am I doing something wrong?
Try to use \ instead of /
If that does not work then try to use \ as a escaped \
I’ve already tried this: /, \, //, /\.
Unfortunately no success.
hmm, I did not notice it removed one of my backslashes, so \\
was not printed.
It looks like one you missed.
Lets hope.
Next try: The error message comes in all four cases:
1: /homeassistant/backup
→ /homeassistant/backup
2: //homeassistant//backup
→ //homeassistant//backup
3: \homeassistant\backup
→ \\homeassistant\\backup
4: /\homeassistant/\backup
→ /\\homeassistant/\\backup
In cases 3 and 4 it claims to have received one more back slash.
Try with just one folder and also try without a leading slash of any kind.
Thanks for the hint. t looks like the regex is used to prevent a leading slash. I followed a video tutorial that showed a slash that was later removed without comment - sorry, my fault.
Thanks
We found it. That is all that matters.
However, this is not clear from the error message. The normal user is not familiar with regex. It says “does not match regular expression…”. IMHO the other way around, the failure occurred because regex matched.
Why not a message like “please remove the leading slash” that everyone would understand?
I so agree with opinion.
I have a hard time figuring out regex too. I can only imagine how confusing this must be to someone that have never heard of regex before. A search to figure out what regex is will not help either, because the learning curve is just way too steep there.
@gerald-00 could you please share how you ended up formatting the path name? I’m having the same issue but for the life of me… I can’t get it right
Thanks in advance.