# Query Syntax

PublicWWW searches the source code of web pages, not the text visitors see. A query is the fragment of markup, script or stylesheet you expect to find - a tracker id, a library filename, a meta tag, an affiliate code.

## Everything, briefly

`"..."` Exact phrase - those words, in that order; other characters only separate them. What you want almost every time. A tilde and a number let the words inside move apart. `"math.min.js"` (https://publicwww.com/websites/%22math.min.js%22/) `"gtag config"~5` (https://publicwww.com/websites/%22gtag%20config%22~5/) [read more](https://publicwww.com/docs/query-syntax/basics/)

`a b` Several words or phrases means all of them, in any order. `distance:n` asks for them close together. `bootstrap jquery` (https://publicwww.com/websites/bootstrap+jquery/) `fbq distance:5 init` (https://publicwww.com/websites/fbq%20distance%3A5%20init/) [read more](https://publicwww.com/docs/query-syntax/basics/)

`( | )` A bar matches either side; brackets say what the bar applies to. `jquery (slick | swiper)` (https://publicwww.com/websites/jquery%20%28slick%20%7C%20swiper%29/) [read more](https://publicwww.com/docs/query-syntax/basics/)

`-` A dash removes the pages that contain what follows it. `"amcharts.js" -bootstrap` (https://publicwww.com/websites/%22amcharts.js%22+-bootstrap/) [read more](https://publicwww.com/docs/query-syntax/basics/)

`\"` A backslash escapes a quote inside a phrase, or another backslash. `"<html lang=\"fr\">"` (https://publicwww.com/websites/%22%3Chtml+lang%3D%5C%22fr%5C%22%3E%22/) [read more](https://publicwww.com/docs/query-syntax/basics/)

`depth:` Reach indexed internal pages, not only home pages. `depth:all "math.min.js"` (https://publicwww.com/websites/depth:all+%22math.min.js%22/) [read more](https://publicwww.com/docs/query-syntax/operators/)

`site:` Restrict to one top-level domain. `site:de bootstrap` (https://publicwww.com/websites/site:de+bootstrap/) [read more](https://publicwww.com/docs/query-syntax/operators/)

`ip:` One address, or a class C subnet with a `*`. `ip:185.199.108.* bootstrap` (https://publicwww.com/websites/ip:185.199.108.*+bootstrap/) [read more](https://publicwww.com/docs/query-syntax/operators/)

`like:` Results in order of similarity instead of popularity: about a topic, in any language, or like a given website. `like:"Tierarzt" site:de` (https://publicwww.com/websites/like:%22Tierarzt%22+site:de/) `like:jquery.com` (https://publicwww.com/websites/like:jquery.com/) [read more](https://publicwww.com/docs/query-syntax/like/)

Only the Latin letters `a-z`, the digits `0-9` and the underscore `_` are searched. Every other character works like a space - punctuation, accented letters, and the letters of other alphabets: Cyrillic, Greek, Arabic, Chinese and the rest. Words written in other alphabets are therefore moved into `like:"..."` automatically: similarity search takes words in any language and alphabet and finds websites about that topic - see [Similar websites](https://publicwww.com/docs/query-syntax/like/). To match the code itself, look for the Latin traces a page carries - a transliterated word, the language in the `<html>` tag, the country domain. More in [Languages](https://publicwww.com/docs/languages/).

## In detail

- [Basics](https://publicwww.com/docs/query-syntax/basics/) - words, exact phrases, combining, excluding, escaping.
- [Operators](https://publicwww.com/docs/query-syntax/operators/) - `depth:`, `site:`, `like:`, `ip:`.
- [Similar websites](https://publicwww.com/docs/query-syntax/like/) - `like:`: results in order of similarity instead of popularity.
- [Regular expressions](https://publicwww.com/docs/query-syntax/regex/) - `snipexp:`, with worked examples.
- [Country domains](https://publicwww.com/docs/query-syntax/cctld/) - every top-level domain PublicWWW indexes.

## Where to go next

- [Signatures](https://publicwww.com/docs/signatures/) - how to find the code a product leaves on its customers' websites.
- [Technologies](https://publicwww.com/docs/examples/) - ready-made queries by topic.
- [API](https://publicwww.com/docs/api/) - the same searches from your own code.
- [Clusters](https://publicwww.com/docs/clusters/) - keep and compare sets of results.

Source: https://publicwww.com/docs/query-syntax/
