सिंटैक्स के बारे में जानकारी
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इस पेज पर, Code Search के लिए काम करने वाले फ़िल्टर, ऑपरेटर, सिंटैक्स के विकल्प, और कीबोर्ड शॉर्टकट के बारे में पूरी जानकारी दी गई है.
काम करने वाले फ़िल्टर
यहां दी गई टेबल में, कोड खोजते समय इस्तेमाल किए जा सकने वाले फ़िल्टर दिए गए हैं.
फ़िल्टर |
दूसरे विकल्प |
ब्यौरा |
उदाहरण |
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: की कीमत का |
उपनाम |
C++ |
c++ |
cpp , cc , cxx |
C |
c |
|
Java |
java |
|
Kotlin |
kotlin |
kt , kts |
Python |
python |
py |
JavaScript |
javascript |
js |
ऐप पर जाएं |
go |
golang |
JSON |
json |
|
एचटीएमएल |
html |
angular |
Objective-C++ |
objectivec++ |
|
Objective-C |
objectivec |
objc |
Markdown |
markdown |
md |
AppleScript |
applescript |
|
C# |
c# |
csharp |
सीएसएस |
css |
|
CSV |
csv |
|
curl |
curl |
|
Dart |
dart |
|
Django |
django |
|
JSP |
jsp |
|
Perl |
perl |
|
PHP |
php |
|
PowerShell |
powershell |
|
Ruby |
ruby |
|
Rust |
rust |
rs |
शेल |
shell |
bash , sh |
एसएचटीएमएल |
shtml |
|
SQL |
sql |
|
Swift |
swift |
|
Tcl |
tcl |
|
XML |
xml |
|
XSLT |
xslt |
|
YAML |
yaml |
|
ये ऑपरेटर इस्तेमाल किए जा सकते हैं
यहां दी गई टेबल में, कोड खोजते समय इस्तेमाल किए जा सकने वाले ऑपरेटर दिए गए हैं.
सिंटैक्स के अन्य विकल्प
कोड खोजने के लिए, सिंटैक्स के ये अतिरिक्त विकल्प इस्तेमाल किए जा सकते हैं.
विकल्प |
ब्यौरा |
(search_expression) |
यह एक से ज़्यादा शब्दों को एक साथ ग्रुप करता है. ज़्यादा जानकारी के लिए,
खोज के लिए इस्तेमाल किए गए शब्दों को ग्रुप करना लेख पढ़ें. |
- |
इस विकल्प को चुनने पर, खोज के नतीजों में यह शब्द नहीं दिखेगा. |
\ |
. , \ या ( जैसे खास वर्णों को छोड़ देता है. |
"search_expression" |
खोज क्वेरी को रेगुलर एक्सप्रेशन के तौर पर इस्तेमाल किए बिना, लिटरल सर्च करें. |
काम करने वाले कीबोर्ड शॉर्टकट
Code Search में उपलब्ध कीबोर्ड शॉर्टकट देखने के लिए, ?
टाइप करें.
नीचे दी गई टेबल में, कोड खोजते समय इस्तेमाल किए जा सकने वाले कीबोर्ड शॉर्टकट दिए गए हैं.
कुंजी(कुंजियां) |
कार्रवाई |
h |
फ़ाइल में किए गए बदलाव का इतिहास दिखाएं. |
q |
सबसे नीचे मौजूद पैनल को टॉगल करें. |
b |
'किसने बदला' लेयर को दिखाएं या छिपाएं. |
f |
'ढूंढें' बार दिखाएं. |
/ |
फ़ोकस को खोज बॉक्स पर ले जाएं. |
o |
फ़ोकस को आउटलाइन ब्राउज़र पर ले जाएं. |
t |
फ़ोकस को डायरेक्ट्री ट्री पर ले जाएं. |
l |
इससे लिंक वाला ड्रॉप-डाउन खुलता है. |
lp |
यह विकल्प, Links ड्रॉप-डाउन में मौजूद फ़ाइल पाथ को कॉपी करता है. |
lh
|
यह विकल्प, लिंक ड्रॉप-डाउन में मौजूद फ़ाइल के HEAD वर्शन का लिंक कॉपी करता है. |
lr
|
यह फ़ाइल के मौजूदा वर्शन और 'लिंक' ड्रॉप-डाउन में मौजूद मौजूदा लाइन का लिंक कॉपी करता है. |
.
|
खोज बॉक्स में रहते हुए, मौजूदा डायरेक्ट्री में कोड या फ़ाइलें खोजें. |
j |
खोज के नतीजों में अगला नतीजा चुनें. |
k |
खोज के नतीजों में पिछला नतीजा चुनें. |
x |
सिंबल के लिए क्रॉस रेफ़रंस दिखाएं. |
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 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. |"]]