Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328251 - Add 'not matches' operator
Summary: Add 'not matches' operator
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: b3 (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-20 11:05 EDT by Henrik Lindberg CLA
Modified: 2017-09-13 11:52 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.