title: Vim regex - hex character in replacement?
body: <p>I want to do a global substitution over a range of lines in Vim:</p>
  
  <pre><code>:s/pattern/replacement/g
  </code></pre>
  
  <p>The 'pattern' is one character in a set, e.g. <code>[BEINS]</code> and the 'replacement' is a single character.  However, the wrinkle is that the single character is given to me as the 2 digit hex representation of the character in ASCII/Unicode.  Obviously I could look up a hex ASCII chart to see that for example <code>5F</code> is the underscore character then I could type <code>_</code> in the replacement part of the regex.</p>
  
  <p>Is there a way to instead type the hex in the righthand side of the regex?</p>
  
  <p>Things I tried that didn't work include:</p>
  
  <pre><code>:%s/[BEINS]/\x5F/g
  :%s/[BEINS]/\\x5F/g
  </code></pre>
  
  <p>On my Linux workstation I can type <kbd>Ctrl</kbd>-<kbd>Shift</kbd>-<kbd>U</kbd> followed by a hex code followed by <kbd>Enter</kbd> but I was wondering if there was a Vim-specific way to put the hex in the replacement part of the regex.</p>