• Code Search
Home Guides Reference
  • Code Search
  • Home
  • Guides
  • Reference
  • Getting started
  • Cross references
  • Using search filters
    • Searching for files
    • Searching for file contents
    • Searching by language
    • Enabling case-sensitive searches
    • Searching for classes
    • Searching for comments
    • Searching for functions
    • Searching across line breaks
    • Searching for symbols
    • Searching for usages
  • Using operators
    • Using the AND operator
    • Using the OR operator
  • Additional tasks
    • Excluding terms
    • Escaping characters
    • Searching for literals
    • Grouping search terms
  • Home
  • Products
  • Code Search
  • Guides

Escaping characters

By default, searches use RE2 regular expressions. To escape characters so they aren't treated as part of a regular expression, use the \ character. For example, the following example searches for the term main.java.

main\.java

For more information see Additional syntax options in the reference documentation.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2019-12-09 UTC.

  • Supported products

    • Android
    • Chromium
    • Google Open Source
  • About

    • Terms of Service
  • Developer consoles

    • Google API Console
    • Google Cloud Platform Console
    • Google Play Console
    • Firebase Console
    • Actions on Google Console
    • Cast SDK Developer Console
    • Chrome Web Store Dashboard
Google Developers
  • Android
  • Chrome
  • Firebase
  • Google Cloud Platform
  • All products
  • Terms
  • Privacy
  • Sign up for the Google Developers newsletter Subscribe