구문 참조
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 페이지에서는 코드 검색에서 지원되는 필터, 연산자, 구문 옵션, 단축키에 관한 자세한 정보를 제공합니다.
지원되는 필터
다음 표에는 코드 검색 시 사용할 수 있는 필터가 기재되어 있습니다.
필터 |
기타 옵션 |
설명 |
예 |
case:yes |
case:y |
검색 시 대소문자를 구분합니다. 기본적으로 검색 시 대소문자를 구분하지 않습니다.
검색어 여러 개를 그룹화하는 경우 이 필터가 모든 하위 그룹에 상속됩니다. |
case:yes Hello World |
class: |
|
클래스 이름을 검색합니다. |
class:MainClass |
comment: |
|
댓글 내에서 검색합니다. |
comment:bug |
content: |
|
파일 콘텐츠만 검색합니다. 파일 이름은 제외됩니다. |
content:hello |
file: |
filepath:
path:
f: |
파일 이름 또는 경로로 파일을 검색합니다. |
file:test.js |
function: |
func: |
함수 이름을 검색합니다. |
function:print |
lang: |
language: |
특정 언어를 사용하여 결과를 검색합니다. |
lang:java test |
pcre:yes |
|
Perl 호환 정규 표현식을 사용합니다.
여러 줄을 검색하는 데 유용합니다. |
pcre:yes @Provides\s+double |
symbol: |
|
특정 기호를 검색합니다. |
symbol:immutable |
usage: |
|
주석과 문자열 리터럴을 제외하고 검색합니다. |
usage:map |
lang 옵션
아래 표에는 lang:
필터에서 지원하는 일반적으로 사용되는 프로그래밍 언어가 나와 있습니다. 해당하는 경우 값에 별칭을 사용할 수 있습니다.
언어 |
lang: 값 |
별칭 |
C++ |
c++ |
cpp , cc , cxx |
C |
c |
|
자바 |
java |
|
Kotlin |
kotlin |
kt , kts |
Python |
python |
py |
자바스크립트 |
javascript |
js |
Go |
go |
golang |
JSON |
json |
|
HTML |
html |
angular |
Objective-C++ |
objectivec++ |
|
Objective-C |
objectivec |
objc |
마크다운 |
markdown |
md |
AppleScript |
applescript |
|
C# |
c# |
csharp |
CSS |
css |
|
CSV |
csv |
|
curl |
curl |
|
Dart |
dart |
|
Django |
django |
|
JSP |
jsp |
|
Perl |
perl |
|
PHP |
php |
|
PowerShell |
powershell |
|
Ruby |
ruby |
|
Rust |
rust |
rs |
shell |
shell |
bash , sh |
SHTML |
shtml |
|
SQL |
sql |
|
Swift |
swift |
|
Tcl |
tcl |
|
XML |
xml |
|
XSLT |
xslt |
|
YAML |
yaml |
|
지원되는 연산자
다음 표에는 코드 검색 시 사용할 수 있는 연산자가 기재되어 있습니다.
연산자 |
설명 |
AND |
논리 연산자 `AND`입니다. 자세한 내용은 AND 연산자 사용을 참조하세요. |
OR |
논리 연산자 `OR`입니다. 자세한 내용은 OR 연산자 사용을 참고하세요. |
추가 구문 옵션
코드 검색에는 다음과 같은 추가 구문 옵션이 지원됩니다.
옵션 |
설명 |
(search_expression) |
여러 검색어를 함께 그룹화합니다. 자세한 내용은 검색어 그룹화를 참조하세요. |
- |
검색결과에서 검색어를 제외합니다. |
\ |
특수 문자(예: . , \ , ( )를 이스케이프 처리합니다. |
"search_expression" |
검색어를 정규 표현식으로 해석하지 않고 리터럴 검색을 수행합니다. |
지원되는 단축키
Code Search에서 사용할 수 있는 단축키를 보려면 ?
를 입력하세요.
다음 표에는 코드 검색 시 사용할 수 있는 단축키가 기재되어 있습니다.
키 |
작업 |
h |
파일의 업데이트 기록을 표시합니다. |
q |
하단 패널을 전환합니다. |
b |
비난 레이어를 표시하거나 숨깁니다. |
f |
찾기 표시줄을 표시합니다. |
/ |
검색창으로 포커스를 변경합니다. |
o |
개요 브라우저로 포커스를 변경합니다. |
t |
디렉터리 트리로 포커스를 변경합니다. |
l |
링크 드롭다운을 엽니다. |
lp |
링크 드롭다운에서 파일 경로를 복사합니다. |
lh
|
링크 드롭다운에서 파일의 HEAD 버전에 대한 링크를 복사합니다. |
lr
|
파일의 현재 버전과 현재 줄에 대한 링크를 링크 드롭다운에 복사합니다. |
.
|
검색창에 있는 동안 현재 디렉터리에서 코드 또는 파일을 검색합니다. |
j |
검색 결과에서 다음 결과를 선택합니다. |
k |
검색 결과에서 이전 결과를 선택합니다. |
x |
기호의 상호 참조를 표시합니다. |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-28(UTC)
[null,null,["최종 업데이트: 2025-08-28(UTC)"],[[["\u003cp\u003eCode Search allows you to search for code using filters like \u003ccode\u003elang:\u003c/code\u003e, \u003ccode\u003efile:\u003c/code\u003e, and \u003ccode\u003eclass:\u003c/code\u003e to refine your results by language, filename, or class name respectively.\u003c/p\u003e\n"],["\u003cp\u003eYou can use operators like \u003ccode\u003eAND\u003c/code\u003e and \u003ccode\u003eOR\u003c/code\u003e to combine search terms, along with additional syntax options for grouping, excluding, and escaping characters within your queries.\u003c/p\u003e\n"],["\u003cp\u003eCode Search supports keyboard shortcuts for actions such as showing file history (h), toggling the bottom panel (q), and navigating search results (j/k).\u003c/p\u003e\n"],["\u003cp\u003eA wide variety of common programming languages are supported by Code Search, including but not limited to: Python, Java, JavaScript, C++, Go, and more, which can be specified using the \u003ccode\u003elang:\u003c/code\u003e filter and their respective values or aliases.\u003c/p\u003e\n"]]],[],null,["This page provides detailed information on the supported filters, operators,\nsyntax options, and keyboard shortcuts for Code Search.\n\nSupported filters\n\nThe following table lists the filters you can use when searching code.\n\n| Filter | Other options | Description | Example |\n|-------------|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------|\n| `case:yes` | `case:y` | Make the search case sensitive. By default, searches are not case sensitive. If you are grouping multiple search terms, this filter is inherited by all child groups. | `case:yes Hello World` |\n| `class:` | | Search for a class name. | `class:MainClass` |\n| `comment:` | | Search within comments. | `comment:bug` |\n| `content:` | | Search only for file contents. This excludes filenames. | `content:hello` |\n| `file:` | `filepath:` `path:` `f:` | Search for a file by filename or path. | `file:test.js` |\n| `function:` | `func:` | Search for a function name. | `function:print` |\n| `lang:` | `language:` | Search for results by using a specific language. | `lang:java test` |\n| `pcre:yes` | | Use Perl compatible regular expressions. Useful for searching across lines. | `pcre:yes @Provides\\s+double` |\n| `symbol:` | | Search for a specific symbol. | `symbol:immutable` |\n| `usage:` | | Search while excluding comments and string literals. | `usage:map` |\n\nlang options\n\nThe table below lists the commonly used programming languages supported by the\n`lang:` filter. Where applicable, an alias can be used for the value.\n\n| Language | `lang:` value | Aliases |\n|---------------|----------------|--------------------|\n| C++ | `c++` | `cpp`, `cc`, `cxx` |\n| C | `c` | |\n| Java | `java` | |\n| Kotlin | `kotlin` | `kt`, `kts` |\n| Python | `python` | `py` |\n| JavaScript | `javascript` | `js` |\n| Go | `go` | `golang` |\n| JSON | `json` | |\n| HTML | `html` | `angular` |\n| Objective-C++ | `objectivec++` | |\n| Objective-C | `objectivec` | `objc` |\n| Markdown | `markdown` | `md` |\n| AppleScript | `applescript` | |\n| C# | `c#` | `csharp` |\n| CSS | `css` | |\n| CSV | `csv` | |\n| curl | `curl` | |\n| Dart | `dart` | |\n| Django | `django` | |\n| JSP | `jsp` | |\n| Perl | `perl` | |\n| PHP | `php` | |\n| PowerShell | `powershell` | |\n| Ruby | `ruby` | |\n| Rust | `rust` | `rs` |\n| shell | `shell` | `bash`, `sh` |\n| SHTML | `shtml` | |\n| SQL | `sql` | |\n| Swift | `swift` | |\n| Tcl | `tcl` | |\n| XML | `xml` | |\n| XSLT | `xslt` | |\n| YAML | `yaml` | |\n\nSupported operators\n\nThe following table lists the operators you can use when searching code.\n\n| Operator | Description |\n|----------|--------------------------------------------------------------------------------------------------------------|\n| `AND` | Logical \\`AND\\` operator. See [Using the AND operator](/code-search/user/and-operator) for more information. |\n| `OR` | Logical \\`OR\\` operator. See [Using the OR operator](/code-search/user/or-operator) for more information. |\n\nAdditional syntax options\n\nThe following additional syntax options are supported for searching code.\n\n| Option | Description |\n|-----------------------------------------------|------------------------------------------------------------------------------------------------------------------|\n| (\u003cvar translate=\"no\"\u003esearch_expression\u003c/var\u003e) | Groups multiple terms together. See [Grouping search terms](/code-search/user/group-terms) for more information. |\n| `-` | Excludes the term from search results. |\n| `\\` | Escapes special characters such as `.`, `\\`, or `(`. |\n| \"\u003cvar translate=\"no\"\u003esearch_expression\u003c/var\u003e\" | Perform a literal search without interpreting the search query as a regular expression. |\n\nSupported keyboard shortcuts\n\nTo see the keyboard shortcuts available in Code Search, type `?`.\n\nThe following table lists the keyboard shortcuts you can use when searching\ncode.\n\n| Key(s) | Action |\n|--------|-------------------------------------------------------------------------------------------------|\n| h | Show the file's revision history. |\n| q | Toggle the bottom panel. |\n| b | Show or hide the blame layer. |\n| f | Show the find bar. |\n| / | Change focus to the search box. |\n| o | Change focus to the outline browser. |\n| t | Change focus to the directory tree. |\n| l | Opens the Links drop-down. |\n| lp | Copies the file path in the Links drop-down. |\n| lh | Copies the link to the HEAD version of the file in the Links drop-down. |\n| lr | Copies the link to the current version of the file and the current line in the Links drop-down. |\n| . | While in the search box, search for code or files in the current directory. |\n| j | Select the next result in the search results. |\n| k | Select the previous result in the search results. |\n| x | Show cross references for symbols. |"]]