lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lamprecht <clampre...@gmail.com>
Subject Re: QueryParser and Special Characters
Date Mon, 09 May 2005 18:55:33 GMT
You might need a double backslash, since the string \(1\+1\)
represented in Java is "\\(1\\+1\\)" (see the javadocs for
java.util.regex.Pattern for a better explanation).


On 5/9/05, Kipping, Peter <Peter.Kipping@taylorandfrancis.com> wrote:
> The documentation tells us to escape special characters by using the \
> 
> Example:
> 
> \(1\+1\)
> 
> However if we put this in a string
> 
> String query = "\(1\+1\)";
> 
> Then the java compiler throws an Invalid Escape Sequence error.
> QueryParser doesn't seem to recognize the double backslash.  Is there a
> workaround for this?
> 
> Thanks,
> Peter
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message