Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This appears to be caused by the use of ranges within regular expression searches.</p> <p>It doesn't occur for the first character in the range. It doesn't occur at all for non-ranges.</p> <pre><code>&gt; echo a | findstr /r "[A-C]" &gt; echo b | findstr /r "[A-C]" b &gt; echo c | findstr /r "[A-C]" c &gt; echo d | findstr /r "[A-C]" &gt; echo b | findstr /r "[B-C]" &gt; echo c | findstr /r "[B-C]" c &gt; echo a | findstr /r "[ABC]" &gt; echo b | findstr /r "[ABC]" &gt; echo c | findstr /r "[ABC]" &gt; echo d | findstr /r "[ABC]" &gt; echo b | findstr /r "[BC]" &gt; echo c | findstr /r "[BC]" &gt; echo A | findstr /r "[A-C]" A &gt; echo B | findstr /r "[A-C]" B &gt; echo C | findstr /r "[A-C]" C &gt; echo D | findstr /r "[A-C]" </code></pre> <p>According to the <a href="http://ss64.com/nt/findstr.html" rel="nofollow noreferrer"><code>SS64 CMD FINDSTR</code> page</a> (which, in a stunning display of circularity, references this question), the range <code>[A-Z]</code>:</p> <blockquote> <p>... includes the complete English alphabet, both upper and lower case (except for "a"), as well as non-English alpha characters with diacriticals.</p> </blockquote> <p>To get around the problem in my environment, I simply used specific regular expressions (such as <code>[ABCD]</code> rather than <code>[A-D]</code>). A more sensible approach for those that are allowed would be to download <a href="http://www.cygwin.com/" rel="nofollow noreferrer">CygWin</a> or <a href="http://gnuwin32.sourceforge.net/packages.html" rel="nofollow noreferrer">GnuWin32</a> and use <code>grep</code> from one of those packages.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload