title: using sed, how does one match square brackets in a character class?
body: <p>Here's a chunk of the raw data:</p>
  
  <pre><code>00000000  54 6f 70 69 63 20 46 6f  72 75 6d 20 52 65 70 6c  |Topic Forum Repl|
  00000010  69 65 73 20 4c 61 73 74  20 70 6f 73 74 20 31 20  |ies Last post 1 |
  00000020  4c 69 6e 75 78 20 54 6f  64 61 79 20 31 34 3a 34  |Linux Today 14:4|
  00000030  36 3a 35 37 20 62 79 20  4c 69 6e 75 78 20 4f 75  |6:57 by Linux Ou|
  00000040  74 6c 61 77 73 20 32 36  39 20 e2 80 93 20 53 6f  |tlaws 269 ... So|
  00000050  6d 65 6f 6e 65 20 4b 6c  6f 73 65 20 54 68 61 74  |meone Klose That|
  00000060  20 4f 75 74 6c 61 77 73  20 32 38 20 73 79 73 79  | Outlaws 28 sysy|
  00000070  70 68 75 73 2e 6a 6f 6e  65 73 20 48 6f 6c 65 20  |phus.jones Hole |
  00000080  62 79 20 59 4f 42 41 20  5b 20 31 20 32 20 5d 20  |by YOBA [ 1 2 ] |
  00000090  32 20 4c 69 6e 75 78 20  26 20 54 6f 64 61 79 20  |2 Linux &amp; Today |
  000000a0  31 31 3a 34 34 3a 35 31  20 62 79 20 4c 6f 6f 6b  |11:44:51 by Look|
  000000b0  73 20 6c 69 6b 65 20 43  61 6e 6f 6e 69 63 61 6c  |s like Canonical|
  000000c0  20 69 73 20 61 6e 6e 6f  75 63 69 6e 67 20 70 6c  | is annoucing pl|
  000000d0  61 6e 73 20 46 72 65 65  64 6f 6d 20 31 20 6b 72  |ans Freedom 1 kr|
  </code></pre>
  
  <p>It's a hex dump and I'm interested in isolating the text part.
  Here's a sed expression that almost works:</p>
  
  <pre><code>$ sed 's/.* |\([a-zA-Z0-9:&amp; \.]*\)|$/\1/g' hex.dat 
  Topic Forum Repl
  ies Last post 1 
  Linux Today 14:4
  6:57 by Linux Ou
  tlaws 269 ... So
  meone Klose That
   Outlaws 28 sysy
  phus.jones Hole 
  00000080  62 79 20 59 4f 42 41 20  5b 20 31 20 32 20 5d 20  |by YOBA [ 1 2 ] |
  2 Linux &amp; Today 
  11:44:51 by Look
  s like Canonical
   is annoucing pl
  ans Freedom 1 kr
  </code></pre>
  
  <p>Almost. But how to filter that last line though?</p>
  
  <pre><code>$ sed 's/.* |\([a-zA-Z0-9:&amp;\[\] \.]*\)|$/\1/g' hex.dat 
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>    $ sed 's/.* |\([a-zA-Z0-9:&amp;\\[\\] \.]*\)|$/\1/g' hex.dat 
  </code></pre>
  
  <p>Don't work at all (they fail to translate anything).</p>
  
  <p>And:</p>
  
  <pre><code>$ sed 's/.* |\([a-zA-Z0-9:&amp;[] \.]*\)|$/\1/g' hex.dat 
  </code></pre>
  
  <p>obviously can't work.</p>
  
  <p>Thanks for any help.</p>