Project

General

Profile

Actions

Bug #6481

closed

Missing implementation of WRegExpValidator::setRegExp(const std::regex& pattern);

Added by Will Johnson almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
06/26/2018
Due date:
% Done:

0%

Estimated time:

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.

Actions #1

Updated by Roel Standaert over 5 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?

Actions #2

Updated by Will Johnson over 5 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.

Actions #3

Updated by Roel Standaert over 5 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.

Actions #4

Updated by Roel Standaert over 5 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

Actions #5

Updated by Roel Standaert over 5 years ago

  • Status changed from Implemented @Emweb to Resolved
Actions #6

Updated by Roel Standaert over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF