<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Patterns — Bazaar 2.7.0 documentation</title> <link rel="stylesheet" href="../_static/classic.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '2.7.0', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <link rel="shortcut icon" href="../_static/bzr.ico"/> <link rel="search" title="Search" href="../search.html" /> <link rel="top" title="Bazaar 2.7.0 documentation" href="../index.html" /> <link rel="up" title="Bazaar User Reference" href="index.html" /> <link rel="next" title="Repositories" href="repositories-help.html" /> <link rel="prev" title="Storage Formats" href="formats-help.html" /> </head> <body role="document"> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="repositories-help.html" title="Repositories" accesskey="N">next</a></li> <li class="right" > <a href="formats-help.html" title="Storage Formats" accesskey="P">previous</a> |</li> <li><a href="http://bazaar.canonical.com/"> <img src="../_static/bzr icon 16.png" /> Home</a> | </li> <a href="http://doc.bazaar.canonical.com/en/">Documentation</a> | </li> <li class="nav-item nav-item-0"><a href="../index.html">Table of Contents (2.7.0)</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Bazaar User Reference</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="patterns"> <h1>Patterns<a class="headerlink" href="#patterns" title="Permalink to this headline">ΒΆ</a></h1> <p>Bazaar uses patterns to match files at various times. For example, the <code class="docutils literal"><span class="pre">add</span></code> command skips over files that match ignore patterns and preferences can be associated with files using rule patterns. The pattern syntax is described below.</p> <p>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 <code class="docutils literal"><span class="pre">./</span></code>. Patterns specifying absolute paths are not allowed.</p> <p>Patterns may include globbing wildcards such as:</p> <div class="highlight-default"><div class="highlight"><pre><span></span>? - 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 </pre></div> </div> <p>Patterns may also be <a class="reference external" href="http://docs.python.org/library/re.html">Python regular expressions</a>. Regular expression patterns are identified by a <code class="docutils literal"><span class="pre">RE:</span></code> prefix followed by the regular expression. Regular expression patterns may not include named or numbered groups.</p> <p>Case insensitive ignore patterns can be specified with regular expressions by using the <code class="docutils literal"><span class="pre">i</span></code> (for ignore case) flag in the pattern.</p> <p>For example, a case insensitive match for <code class="docutils literal"><span class="pre">foo</span></code> may be specified as:</p> <div class="highlight-default"><div class="highlight"><pre><span></span>RE:(?i)foo </pre></div> </div> <p>Ignore patterns may be prefixed with <code class="docutils literal"><span class="pre">!</span></code>, which means that a filename matched by that pattern will not be ignored.</p> </div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <h4>Previous topic</h4> <p class="topless"><a href="formats-help.html" title="previous chapter">Storage Formats</a></p> <h4>Next topic</h4> <p class="topless"><a href="repositories-help.html" title="next chapter">Repositories</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/user-reference/patterns-help.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <div><input type="text" name="q" /></div> <div><input type="submit" value="Go" /></div> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="repositories-help.html" title="Repositories" >next</a></li> <li class="right" > <a href="formats-help.html" title="Storage Formats" >previous</a> |</li> <li><a href="http://bazaar.canonical.com/"> <img src="../_static/bzr icon 16.png" /> Home</a> | </li> <a href="http://doc.bazaar.canonical.com/en/">Documentation</a> | </li> <li class="nav-item nav-item-0"><a href="../index.html">Table of Contents (2.7.0)</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" >Bazaar User Reference</a> »</li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2009-2011 Canonical Ltd. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9. </div> </body> </html>