Bug #6481
closedMissing implementation of WRegExpValidator::setRegExp(const std::regex& pattern);
0%
Description
In Wt 3.0.4 (and current git) the member function WRegExpValidator::setRegExp(const std::regex&)
is defined but not implemented causing a linker error if you try to use it.
Updated by Roel Standaert over 6 years ago
- Status changed from New to Feedback
That method is indeed missing, but I noticed that that method actually can't be properly implemented. We need the original pattern as a string for the JavaScript side to work. I think we're better off leaving that setter out. Do you have a particular use for it?
Updated by Will Johnson over 6 years ago
I was trying to control regex options being used (e.g., std::regex_constants::syntax_option_type) to allow controlling if case is ignored.
However, in looking over the WRegExpValidator class there look to maybe be a few other issues: the member variable pattern_ is not set when you construct the class with a WString (only regex_ is), and the std::regex constructor also doesn't look to be implemented.
Since allowing library users to set the std::regex (either via the constructor or a setter) would also have the issue that all the options would need to be mirrored in the JavaScript (ex. if std::regex_constants::egrep is chosen), it might make sense to only allow setting the pattern via string, and instead add a member function to control setting case sensitivity (or any other options there may be).
Thank you.
Updated by Roel Standaert over 6 years ago
That other issue you're referring to (pattern_ not being set) should already be fixed in master.
Other than that, we could indeed for the setting of certain options. That was actually already the case for Wt 3, where it was possible to do a case insensitive match, so I guess we should add that back in.
Updated by Roel Standaert over 6 years ago
- Status changed from Feedback to Implemented @Emweb
I added the case insensitive option again.
It is affected by this libstdc bug, though: https://gcc.gnu.org/bugzilla//show_bug.cgi?id=71500
Updated by Roel Standaert over 6 years ago
- Status changed from Implemented @Emweb to Resolved
Updated by Roel Standaert about 6 years ago
- Status changed from Resolved to Closed