CINXE.COM
Beyond grep: ack v3.7.0
<!DOCTYPE html> <html lang="en-US"> <head> <title>Beyond grep: ack v3.7.0</title> <meta name="Author" content="Andy Lester" /> <meta name="google-site-verification" content="qm9jhn-etECEUlDgRf7gRtnJoSD1hmHOQm_iue_ng3A" /> <meta name="msvalidate.01" content="4EF6B7CF4E86418C29626DA5E8B28AF5" /> <base href="https://beyondgrep.com/" /> <link href="https://fonts.googleapis.com/css?family=PT+Serif:400,700,400italic,700italic" rel="stylesheet" type="text/css" /> <link href="https://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic" rel="stylesheet" type="text/css" /> <link rel="shortcut icon" href="/favicon.ico?v=2" /> <link rel="stylesheet" type="text/css" href="/bg.css" /> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-E3JT7VWBME"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-E3JT7VWBME'); </script> <script type="application/ld+json"> { "@context": "http://schema.org/", "@type": "Organization", "url": "https://beyondgrep.com/", "logo": "https://avatars0.githubusercontent.com/u/30610360" } </script> </head> <body> <div class="nav"> <h1 class="logo"><a href="/">ack!</a></h1> <ul> <li><a href="/why-ack/">Why ack?</a></li> <li><a href="/install/">Install</a></li> <li><a href="/documentation/">Documentation</a></li> <li><a href="/community/">Community</a></li> <li><a href="/more-tools/">More Tools</a></li> <li><a href="/feature-comparison/">Feature Chart</a></li> </ul> </div> <div class="billbox"> <div class="billhead"> <pre> _ /| \'o.O' =(___)= U </pre> </div> <div class="billtext"> <h1 class="pkg_mgr_desc">ack is a grep-like source code search tool.</h1> <h2 class="pkg_mgr_desc">The latest version of ack is v3.7.0, released 2023-02-25.</h2> <p> Designed for programmers with large heterogeneous trees of source code, ack is written in portable Perl 5 and takes advantage of the power of Perl's regular expressions. </p> </div> </div> <div class="content"> <div class="feature-bullets"> <h1>What's new in ack?</h1> <h2>New --not option</h2> <p> The new repeatable --not option lets you get more precise matches. If you want to search for "dogs" but not if "cats" or "fish" are on the line, use <p> <pre> ack dogs --not cats --not fish </pre> <h2>Easier to understand error messages</h2> <p> The error message ack displays when the regex passed is invalid has been improved. The message is more readable and includes a pointer to the offending part of the regex. For example: </p> <pre> $ ack 'status: (open|closed|in progress' ack: Invalid regex 'status: (open|closed|in progress' Regex: status: (open|closed|in progress ^---HERE Unmatched ( in regex </pre> <h2>New <tt>--proximate</tt> option groups matches near each other</h2> <p> A new option <tt>--proximate=N</tt> groups together lines of output that are within N lines of each other in the file. This is useful when looking for matches that are related to each other. </p> <p> For example, these results: </p> <pre> 15: First match 18: Second match 19: Third match 37: Fourth match </pre> <p> look like this with <tt>--proximate=1</tt>. </p> <pre> 15: First match 18: Second match 19: Third match 37: Fourth match </pre> <h2>Improved <tt>-w</tt> option</h2> <p> The <tt>-w</tt> option, which tells ack to only find whole-word matches, did not always work if your pattern began or ended with puncutation. ack would make guesses as to what your intent was, but it was not well-defined. Now, ack disallows regexes that begin or end with non-word characters. </p> <p> This means that if you use <tt>ack -w foo:</tt>, the new ack will not allow it, whereas ack 2.x would. </p> <h2>Added <tt>-S</tt> as a synonym for <tt>--smart-case</tt></h2> <p> For those without <tt>--smart-case</tt> always on, the <tt>-S</tt> will be easier for when you do want to use it. </p> <p> Smart-case matching makes ack do a case-insensitive search unless the pattern being matched has a capital letter in it. </p> <h2>Added <tt>-I</tt> to force case-sensitivity</h2> <p> If you use <tt>--smart-case</tt> in your .ackrc, you can use <tt>-I</tt> to force case-sensitivity instead of having to use <tt>--no-smart-case</tt> (which still works). </p> <h2>Significant speed improvements</h2> <p> Run times for ack 3 compared to ack 2.22 are 30-40% faster because of removal of unused infrastructure for plugins. </p> </div> <div class="feature-install"> <h2>How to install</h2> <p> ack is simple to install, via CPAN, package or simple download. <a href="/install/">Read how</a>. </p> </div> <div class="feature-testimonials"> <h2>People love ack</h2> <p> "Every once in a while something comes along that improves an idea so much, you can't ignore it. Such a thing is Ack, the grep replacement." </p> <p> Read <a href="/why-ack/#testimonials">what else people are saying</a>. </p> </div> <div class="feature-twitter"> <h2>Follow us on Twitter</h2> <p> We're all about knowing when to move beyond the stock Unix tools. <a href="https://twitter.com/beyondgrep">Follow us on Twitter at @beyondgrep</a> for tips, hints and software news. </p> </div> </div> <div class="footer"> <p> Ack is copyright 2005-2021 <a href="http://petdance.com/">Andy Lester</a>, <a href="mailto:andy@petdance.com">andy@petdance.com</a>. Ack is free software; you can redistribute it and/or modify it under the terms of the <a href="https://www.opensource.org/licenses/Artistic-2.0">Artistic License v2.0</a>. </p> <p> Website design by Ashraful Sheikh and <a href="https://jeana.dev/">Jeana Clark</a> <small>(available to fork on <a href="https://github.com/beyondgrep/website" class="github-logo">GitHub</a>)</small>. </p> <p> ack and beyondgrep.com are supported by <a href="https://m.do.co/c/6a437192f552">DigitalOcean</a>. </p> <p> <a href="https://m.do.co/c/6a437192f552"> <img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_horizontal_blue.svg" width="201px" /> </a> </p> </div> </body> </html>