Back to Gitlabhq

Syntax options

doc/drawers/exact_code_search_syntax.md

18.11.23.3 KB
Original Source
<!-- Remember to also update the table in `doc/user/search/exact_code_search.md` -->
QueryExact match modeRegular expression mode
"foo""foo"foo
foo file:^doc/foo in directories that start with /docfoo in directories that start with /doc
"class foo""class foo"class foo
class fooclass fooclass and foo
foo or barfoo or barfoo or bar
class Fooclass Foo (case-sensitive)class (case-insensitive) and Foo (case-sensitive)
class Foo case:yesclass Foo (case-sensitive)class and Foo (both case-sensitive)
foo -barfoo -barfoo but not bar
foo file:jsfoo in files with names that contain jsfoo in files with names that contain js
foo -file:testfoo in files with names that do not contain testfoo in files with names that do not contain test
foo lang:rubyfoo in Ruby source codefoo in Ruby source code
foo file:\.js$foo in files with names that end with .jsfoo in files with names that end with .js
foo.*barfoo.*bar (literal)foo.*bar (regular expression)
sym:foofoo in symbols like class, method, and variable namesfoo in symbols like class, method, and variable names
test repo:(?i)footest in projects with foo in their name (case-insensitive); repo: supports regular expressionstest in projects with foo in their name (case-insensitive); repo: supports regular expressions