- Timestamp:
- 2013-12-07T22:38:45+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r6070 r6455 64 64 public static enum Op { 65 65 EQ, NEQ, GREATER_OR_EQUAL, GREATER, LESS_OR_EQUAL, LESS, 66 REGEX, ONE_OF, BEGINS_WITH, ENDS_WITH, CONTAINS; 66 REGEX, NREGEX, ONE_OF, BEGINS_WITH, ENDS_WITH, CONTAINS; 67 67 68 68 public boolean eval(String testString, String prototypeString) { … … 75 75 return !equal(testString, prototypeString); 76 76 case REGEX: 77 case NREGEX: 77 78 Pattern p = Pattern.compile(prototypeString); 78 79 Matcher m = p.matcher(testString); 79 return m.find(); 80 return REGEX.equals(this) ? m.find() : !m.find(); 80 81 case ONE_OF: 81 82 String[] parts = testString.split(";"); -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
r6248 r6455 368 368 <EQUAL> <TILDE> { op=Condition.Op.REGEX; } s() val=regex() 369 369 | 370 LOOKAHEAD(2) 371 <EXCLAMATION> <TILDE> { op=Condition.Op.NREGEX; } s() val=regex() 372 | 370 373 ( 371 374 <EXCLAMATION> <EQUAL> { op=Condition.Op.NEQ; }
Note:
See TracChangeset
for help on using the changeset viewer.