FAQ
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

Search Discussions

  • Chris Lamprecht at May 9, 2005 at 6:56 pm
    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 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedMay 9, '05 at 6:28p
activeMay 9, '05 at 6:56p
posts2
users2
websitelucene.apache.org

2 users in discussion

Kipping, Peter: 1 post Chris Lamprecht: 1 post

People

Translate

site design / logo © 2022 Grokbase