doc-small.jpg       

P o r g l e

--- Search the FreeBSD Ports Collection ---

Last ports database update:  2010-08-03
Current ports count:  22001

Introduction

Porgle is a search engine that enables you to find ports from the FreeBSD ports collection. It is a full text search that uses the port names and short comments by default, but can also search the full length descriptions and the list of file names from the packing lists. You can use complex search expressions, including extended regular expressions.

For a quick start, look at the "Examples" section at the bottom of this page. However, it is recommended that you read through the whole page, so you can use the search engine most efficiently and get the best results from it.

Types of Data

By default, the following types of data are searched (i.e. your search expression is matched against these):

If you click the appropriate check-boxes at the top, the following types of data can be searched, too:

More search types are planned to be implemented in the future.

Search expressions

A search expression consists of words and operators. You can use the standard operators "AND", "OR", "NOT", and group them with parentheses if necessary. See below for more information on operators.

Words are simply fixed strings which will be searched for. If they contain spaces or special characters (i.e. anything except letters and digits), enclose them in single or double quotes. You can also use extended regular expressions by enclosing the word in slashes.

Please note that all searches are case-insensitive, and they are sub-string matches, not whole-word matches.

Also note that at most 100 matching ports will be displayed. This limit exists in order to not overload the web server or your web browser. If your search yields more than 100 results, the first 100 will be displayed, followed by a warning. In that case, your search expression was probably too broad, so you should try to refine it, for example by exluding common words from ports which you're not interested in.

Operators

In the following list, the operators are listed from lowest (least binding) to highest (most binding) precedence. Multiple operators of the same precedence are evaluated from left to right.

Most of the operators have alternate spellings -- for example, the operator "AND" can also be written as "+", "&" or "&&". Note that operators are case-insensitive, so you can write "AND" as well as "And" or "and" or even "aNd". In this documentation, all operators are written in upper-case letters, so they can be easier recognized.

OR    (alternatives: |, ||)

If multiple words or sub-expressions are connected with the "OR" operator, then at least one of them must match.

AND    (alternatives: +, &, &&)

If multiple words or sub-expressions are connected with the "AND" operator, then all of them must match. Note that this is the default if there are no operators at all, i.e. when you just list multiple words.

NOT    (alternatives: -, !)

If a word or sub-expression is preceded by the "NOT" operator, then it must not match.

( )

Parentheses can be used to group sub-expressions in order to override the standard operator precedence.

Fixed Words

Fixed words are just simple character strings which are supposed to match sub-strings of the name, comment or description of the ports. Ordinarily, they can consist of letters (the case doesn't matter) and digits.

If you need to specify a word that contains special characters (particularly spaces or characters that would be confused with operators), enclose the whole word with single or double quotes. A quoted word may contain any characters, except for the quote character itself.

Extended Regular Expressions

If a word begins with a slash character ("/"), then it is interpreted as an extended regular expression. In that case, it must also end with a slash, and it may contain arbitrary characters (except for the slash) as if it was quoted.

In the case of the port description -- which may span multiple lines -- the regular expression is applied to the whole description at once, and the "." character will also match a newline.

The particular implementation of extended regular expressions is that of the Python "re" module. Please refer to the documentation of the re syntax for details. For most purposes, it is sufficient to assume that it works the same as the UNIX® egrep(1) command.

Examples

Example #1

To search for ports that contain both the words "foo" and "bar", but not the word "baz", you can use this search expression:

foo bar -baz

It is exactly the same as the following, more verbose one:

foo AND bar AND NOT baz

Example #2

Now suppose you want to search for ports that contain either the word "foo" or the word "bar" (not necessarily both at the same time, although that's permitted, too), and still exclude ports containing the word "baz". The naive approach would be to simply replace the "AND" operator with an "OR" operator:

foo OR bar AND NOT baz

But that won't work as expected, because the "OR" operator has a lower precedence as the "AND" operator, so what really happens is this:

foo OR (bar AND NOT baz)

Which is not what we want: It matches all ports that contain the word "bar" and not the word "baz", or those that contain the word "foo", regardless whether they also contain the word "baz" or not. Instead, this is what you want:

(foo OR bar) AND NOT baz

Or shorter:

(foo OR bar) -baz

Example #3

Regular expressions can be useful if you're looking for multiple words that are similar.

Let's assume you're looking for a port containing the words "editor" and "color", but you would like to allow both British and American spelling. This would be a simple working approach:

editor AND (color OR colour)

However, in this case it is easier to use a regular expression, which is much shorter. (It might be less readable, though, if you're not familiar with regular expressions.) The following should return exactly the same results as the longer search expression above (remember that "AND" is optional, so it can be omitted):

editor /colou?r/

Example #4

Another common case for regular expressions is when you're looking for words that occur in a specific order.

Suppose you want to search for the words "syntax" and "highlight". If you just specify those two words, Porgle will find all ports that contain both of them, regardless of the order. But you want to find only those ports that contain "syntax" followed by "highlight" (with other stuff in between), not the other way round. A regular expression will do nicely:

/syntax.*highlight/

That one will find all occurences of "syntax", follwed by anything, followed by "highlight". If you want to find ports that contain the words "syntax highlight" together (with just a space between), then you can simply specify a quoted string:

"syntax highlight"


[Valid XHTML 1.0]