[Spreadsheet] fix isValidAlias()
Alias validation was broken in one of my previous PR's. This fixes the issue introduced in https://github.com/FreeCAD/FreeCAD/pull/17315
Incorrectly, I previously thought the re matching was only looking for valid address strings, but it was also looking for invalid characters, such as spaces or quote characters in the alias name. The relevant re search was moved back into isValidAlias().
I also added an alias named with spaces and another with a leading single quote character to the unit tests. I am not entirely sure these tests are actually being run. @chennes can you have a look? I tried adding one of the invalid names to the valid names list, but it did not trigger the expected test failure. Instead, all tests passed when that one should have failed. Method to run was from the linux terminal in the build folder:
./bin/FreeCAD -t0
As a sidenote there appear to be lots of exceptions getting thrown in the unit tests, but they aren't triggering test failures.
What lead me back here was this post on the forum:
https://forum.freecad.org/viewtopic.php?t=92952
It seems when copying the contents of a cell that has a string in it the leading singlequote is also copied, and when this is simply pasted into the Alias QLineEdit widget it can lead to a crash. This should resolve that crash because now the alias name with the leading quote is flagged as an invalid alias and so setAlias() isn't being called on it. I considered automatically removing the leading single quote, but then upon investigating found this bug that this PR is fixing.