syncope-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Varon <varont...@gmail.com>
Subject Re: Misleading policy documentation (minor)
Date Tue, 17 Apr 2018 15:45:59 GMT
Yes you are correct, obviously.  My point is that the reference to the java
documentation led me to conclude erroneously that the pattern would be
interpreted as a java string literal, requiring the double-escape.
Clarifying this is not the case would eliminate any confusion.  For
example:

pattern - Java regular expression pattern to match; NULL means no match is
attempted; The pattern is not interpreted as a String literal, therefore
double-escaping (e.g., \\s, \\w) is not required.

I obviously know it now, so it isn't an issue for me anymore.

Grazie, as always, for your attention, tremendous effort, and awesome
product.

Dave

On Tue, Apr 17, 2018 at 11:30 AM, Francesco Chicchiriccò <
ilgrosso@apache.org> wrote:

> On 17/04/2018 17:25, varontron wrote:
>
>> Hi,
>>
>> In configuring an Account policy, I included a pattern conformity
>> requirement.
>>
>> [\\w@\\-\\.]+
>>
>> meaning all one word or a normal email address, and ok, hyphens too.
>>
>> However, as you may have noticed, the double-backslashes confound the
>> pattern.  It should instead be:
>>
>> [\w@\-\.]+
>>
>> This appeared to work as intended.
>>
>> The Reference Guide states "pattern - Java regular expression pattern to
>> match; NULL means no match is attempted;"
>>
>> I inferred from this that, like in java regex strings, double-backslashes
>> were required for special characters:
>>
>> "The backslash character ('\') serves to introduce escaped constructs, as
>> defined in the table above, as well as to quote characters that otherwise
>> would be interpreted as unescaped constructs. Thus the expression \\
>> matches
>> a single backslash and \{ matches a left brace."
>>
>> Perhaps the docs could clarify this?
>>
>
> Hi,
> I don't think so: it's
>
> [\\w@\\-\\.]+
>
> when you use it inside a string literal in Java, but the actual regex is
> always
>
> [\w@\-\.]+
>
> Regards.
>
> --
> Francesco Chicchiriccò
>
> Tirasa - Open Source Excellence
> http://www.tirasa.net/
>
> Member at The Apache Software Foundation
> Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
> http://home.apache.org/~ilgrosso/
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message