[ 
https://issues.apache.org/jira/browse/JCR-4042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15593116#comment-15593116
 ] 

Vikas Saurabh commented on JCR-4042:
------------------------------------

[~amitgupt],
bq. just need escape character for colon
Pedantically speaking simple escaping won't work. There are probably 2 ways 
that we can think of escaping:
# use double colon to represent an escaped colon
# use another character (probably backslash) as escape sequence prefix

For case#1, there's no way to disambiguate {{a:::b}} between {{a:":b"}} and 
{{"a:":b}}... unless, we then also say that field names can't end in colon 
(which, afaik, isn't a restriction put by gql as of now).

For case#2, it'd require a list (of at least 2 characters - {{:}} and {{\}} 
)... and once we have a list why not put more (say double-quotes).

Btw, I think to maintain backward compatibility - colon would need to be 
allowed without escaping if quoted -> so, {{"a:b"}} must remain similar to 
{{a\:b}} and not {{a:b}}. 

> Adding Escape Character in GQL
> ------------------------------
>
>                 Key: JCR-4042
>                 URL: https://issues.apache.org/jira/browse/JCR-4042
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-jcr-commons
>            Reporter: Ankit Agarwal
>
> Currently GQL does not have a escape character. Adding the escape character 
> will help in special character cases for example where a search term contains 
> both colon(:) and quote(") character.
> for example search string is foo:bar, if term is put in quote "foo:bar" and 
> this whole term is considered as a single search value. 
> But in case user need to search foo"abc:bar then putting this term in quotes 
> won't work. But if GQL will have a escape character, then user can search 
> this term using escape character. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to