Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328251

Summary: Add 'not matches' operator
Product: z_Archived Reporter: Henrik Lindberg <henrik.lindberg>
Component: b3Assignee: Project Inbox <b3.engine-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Henrik Lindberg CLA 2010-10-20 11:05:03 EDT
Currently a negative matches has to be written ! a ~= ~/pattern/ which is ok in short expressions but makes it harder to read when expression are long, or combined with logical connectives where paranthesis are required.

Implementing a "not matches" would be very simple. 
Selecting the operator is a bit tricky - it should read as "not matches", and the best choice seems to be:
!~

But since matches is ~=, it should perhaps be (klunky) !~=. Changing the matches operator to =~ makes more sense (and brings the operator inline with ruby's notation).

=~ matches
!~ not matches

=~ ~/pattern/
!~ ~/pattern/
Comment 1 Henrik Lindberg CLA 2010-10-20 22:15:42 EDT
Added !~ as not matches, but did not change the ~= operator.
Added tests.