summaryrefslogtreecommitdiff
path: root/bzrlib/help_topics/en/patterns.txt
diff options
context:
space:
mode:
Diffstat (limited to 'bzrlib/help_topics/en/patterns.txt')
-rw-r--r--bzrlib/help_topics/en/patterns.txt38
1 files changed, 38 insertions, 0 deletions
diff --git a/bzrlib/help_topics/en/patterns.txt b/bzrlib/help_topics/en/patterns.txt
new file mode 100644
index 0000000..6250d20
--- /dev/null
+++ b/bzrlib/help_topics/en/patterns.txt
@@ -0,0 +1,38 @@
+Patterns
+========
+
+Bazaar uses patterns to match files at various times. For example,
+the ``add`` command skips over files that match ignore patterns
+and preferences can be associated with files using rule patterns.
+The pattern syntax is described below.
+
+Trailing slashes on patterns are ignored. If the pattern contains a
+slash or is a regular expression, it is compared to the whole path
+from the branch root. Otherwise, it is compared to only the last
+component of the path. To match a file only in the root directory,
+prepend ``./``. Patterns specifying absolute paths are not allowed.
+
+Patterns may include globbing wildcards such as::
+
+ ? - Matches any single character except '/'
+ * - Matches 0 or more characters except '/'
+ /**/ - Matches 0 or more directories in a path
+ [a-z] - Matches a single character from within a group of characters
+
+Patterns may also be `Python regular expressions`_. Regular expression
+patterns are identified by a ``RE:`` prefix followed by the regular
+expression. Regular expression patterns may not include named or
+numbered groups.
+
+Case insensitive ignore patterns can be specified with regular expressions
+by using the ``i`` (for ignore case) flag in the pattern.
+
+For example, a case insensitive match for ``foo`` may be specified as::
+
+ RE:(?i)foo
+
+Ignore patterns may be prefixed with ``!``, which means that a filename
+matched by that pattern will not be ignored.
+
+.. _Python regular expressions: http://docs.python.org/library/re.html
+