title: How to replace only whole words using Firebird?
body: <p>I need to write an SQL text for replacing only entire words.</p>
  
  <p>For "whole word" I mean all occurrences which are not part of another alphanumeric word.</p>
  
  <p><strong>Example:</strong></p>
  
  <p>Replacing 'abc' with 'xyz'</p>
  
  <pre><code>| MYFIELD |
  | 'test abc test' |
  | 'abctest' |
  | 'testabctest' |
  | 'testabc' |
  | 'abc test' |
  | 'test abc' |
  | 'abc' |
  | ' abc ' |
  </code></pre>
  
  <p><strong>Expected result:</strong></p>
  
  <pre><code>| MYFIELD |
  | 'test xyz test' |
  | 'abctest' |
  | 'testabctest' |
  | 'testabc' |
  | 'xyz test' |
  | 'test xyz' |
  | 'xyz' |
  | ' xyz ' |
  </code></pre>
  
  <p>I've prepared an <a href="https://regex101.com/r/vLXFnh/3" rel="nofollow noreferrer">example</a> using a common regular expression engine.</p>
  
  <p>I've tried porting the same RegEx in Firebird SQL, using <a href="https://firebirdsql.org/refdocs/langrefupd25-similar-to.html" rel="nofollow noreferrer">SIMILAR TO</a>, but it didn't worked as expected:</p>
  
  <pre><code>UPDATE mytable
  SET mytable = REPLACE(myfield, 'abc', 'xyz')
  WHERE myfield SIMILAR TO '\babc\b'
  </code></pre>