[ 
https://issues.apache.org/jira/browse/JSIEVE-19?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595939#action_12595939
 ] 

Stefano Bagnara commented on JSIEVE-19:
---------------------------------------

I don't know jsieve too much and I don't have any sieve script to test.
I don't know what kind of comparisons are supported by jsieve and what are 
mandated/optional for sieve.

I simply wanted to fix this specific issue and remove oro.
There was no parameters in the ComparatorUtils.matches call, so I guess it have 
to be case sensitive or case insensitive but this is not selectable ATM.

The code I wrote is:
return Pattern.compile(regex, 
Pattern.CASE_INSENSITIVE).matcher(string).matches();

so it uses the CASE_INSESITIVE.
I would simply like to understand if I have to leave the CASE_INSENSITIVE there 
or not.

Furthermore my other doubt is the escaping. The specification says:
   The ":matches" version specifies a wildcard match using the
   characters "*" and "?".  "*" matches zero or more characters, and "?"
   matches a single character.  "?" and "*" may be escaped as "\\?" and
   "\\*" in strings to match against themselves.  The first backslash
   escapes the second backslash; together, they escape the "*".  This is
   awkward, but it is commonplace in several programming languages that
   use globs and regular expressions.

I simply used \? for the escaped question mark because I supposed the first \ 
is already escaped by jsieve parsing the quoted string, but I didn't test real 
scripts and I don't know how jsieve works there, so please someone with this 
knowledge overview.

Answering the 2 questions (case senstivity and escaping) should allow me to 
close this issue.

> Open square bracket as first char in matching pattern does not work
> -------------------------------------------------------------------
>
>                 Key: JSIEVE-19
>                 URL: https://issues.apache.org/jira/browse/JSIEVE-19
>             Project: jSieve
>          Issue Type: Bug
>    Affects Versions: 0.2
>            Reporter: Stefano Bagnara
>            Assignee: Stefano Bagnara
>             Fix For: 0.2
>
>
> this rule
> if header :matches \"X-Caffeine\" \"[test]*\" {throwTestException;}
> does not match for 
> X-Caffeine: [test] something
> Removing the open square or moving it as the second char instead works.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to