searchcode logo

Search Examples

  1. Codesearch
    1. Standard Codesearch
    2. Example Standard Searches
    3. Filters
      1. File Extention Filters
      2. Language Filters
      3. Repo Filters
      4. URL Filters
    4. Use Cases
      1. Use Case 1 Example
      2. Use Case 2 Example
      3. Use Case 3 Example
  2. Regex Codesearch
  3. DuckDuckGo Bang!
  4. Documentation Search
  5. Documentation Lists

Codesearch

Standard searches support special characters such as !@#$%^&*()<> As such a search such as [a-z] is a valid search in searchcode. Searches which cannot find exact matches will fall back to finding as close a match as possible.

Example Searches

Filters

File Extention Filters

You can filter by file extentions. To do so you add the following text at the end of your search ext:EXT where EXT is the file extention you wish to filter on. The full list of extentions is too large to list but includes the following, php, py, c, cpp, m, makefile, xml, css, js etc... See the below for searches filtered by extention.

Language Filters

You can filter by language. To do so you add the following text at the end of your search lang:LANG where LANG is the language you wish to filter on. The full list of languages is large and includes Python, PHP, Ruby, C++, Mumps, Cobol etc... see Full List of Languages. See the below for examples of searches filtered by language.

Repo Filters

You can filter by repositries if you know the name. To do so you add the following text at the end of your search repo:REPO where REPO is the name the of repository you wish to filter on. See the below for examples of searches filtered by repo.

URL Filters

You can filter by source URL if you know the name. To do so you add the following text at the end of your search url:URL where URL is one of the following.

See the below for examples of searches filtered by url.

Use Cases

Use Case 1

Daryl is learning how to use Backbone.js and would like to see some real world examples of how to implement a backbone collection. He can search for the following, Backbone.Collection.extend and will see a collection of projects and files already using backbone collections.

Use Case 2

Tim has forgotten how to implement regular expressions in Python. He is pretty sure its re.compile but cant quite remember all the options that exist. A search for re.compile returns a lot of examples for him to follow.

Use Case 3

Sally is looking for a simple regular expression which she can use to find emails in some text using Python. A search for email regex lang:python returns a lot of examples to copy from.

Regex Codesearch

searchcode supports basic POSIX regex commands. An example of each supported case is included below. To trigger the regex search enclose your searchterm/regex using a forward slash E.g. /test/

DuckDuckGo !Bang

All of the DuckDuckGo DuckDuckGo !Bang queries are supported. Use any DuckDuckGo bang syntax as expected, with the exception that !d will redirect to DuckDuckGo itself.

Where documentation exists relevent to your search it will appear.

Searchable inline documentation exists for the following categories.

Documentation Lists

View lists of all documentation in a single place.