PengZheng commented on PR #692:
URL: https://github.com/apache/celix/pull/692#issuecomment-1848402945

   According to OSGi [3.2.7 Filter Syntax 
](https://docs.osgi.org/specification/osgi.core/8.0.0/framework.module.html#framework.module.filtersyntax)
   
   ```
   substring   ::= attr '=' initial any final
   initial     ::= () | value
   any         ::= '*' star-value
   star-value  ::= () | value '*' star-value
   final       ::= () | value
   ```
   
   > `value` is a string representing the value, or part of one, which will be 
compared against a value in the
   filtered properties.
   If `value` must contain one of the characters reverse solidus ('\' \u005C), 
asterisk ('*' \u002A), paren-
   theses open ('(' \u0028) or parentheses close (')' \u0029), then these 
characters should be preceded
   with the reverse solidus ('\' \u005C) character. Spaces are significant in 
`value`. Space characters are
   defined by Character.isWhiteSpace().
   
   If "space characters are significant in `value`", the following test should 
pass:
   
   ```C++
   TEST_F(FilterTestSuite, SubStringTest) {
       celix_autoptr(celix_properties_t) props = celix_properties_create();
       celix_properties_set(props, "test", "John Bob Doe");
       celix_properties_set(props, "test2", "*ValueWithStar");
       celix_properties_set(props, "test3", " Value");
   
       //test filter with mathing subInitial beginning with whitespace
       celix_autoptr(celix_filter_t) filter13 = celix_filter_create("(test3= 
Value*)");
       EXPECT_TRUE(celix_filter_match(filter13, props));
   }
   ```
   But it fails for our current implementation.
   I think the beginning white spaces should not be escape in `value`, which is 
quite different from [Java properties file 
format](https://github.com/apache/celix/issues/685#issuecomment-1848398520). 
And a related 
[issue](https://github.com/apache/celix/issues/685#issuecomment-1848399679) is 
raised there.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to