syncope-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò <ilgro...@apache.org>
Subject Re: Misleading policy documentation (minor)
Date Tue, 17 Apr 2018 15:49:01 GMT
On 17/04/2018 17:45, Dave Varon wrote:
> 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.

You might want to send  a PR for such change, the file is

https://github.com/apache/syncope/blob/2_0_X/src/main/asciidoc/reference-guide/concepts/policies.adoc

If you're willing to contribute, I invite you to submit an ICLA:

http://syncope.apache.org/contributing.html#How_do_I_become_a_contributor_or_a_committer

> 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.

It's our pleasure :-)
Regards.

> 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/
>>
>>

-- 
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
View raw message