title: RegEx for replacing part of a string including single quotes (')
body: <p>I am trying to replace a portion of a text that is between apostrophes, not all, just a part.
  For example, I need to replace the characters /* and */ that are only within text between quotes by null text but not outside them.</p>
  
  <p><strong>My input text, for example:</strong></p>
  
  <pre><code>A = 'THIS IS AN ALPHABETIC /* CONSTANT' || WS_CON1 /* */ || 'TEST STRING */';
  </code></pre>
  
  <p><strong>Expected output:</strong></p>
  
  <pre><code>A = 'THIS IS AN ALPHABETIC  CONSTANT' || WS_CON1 /* */ || 'TEST STRING ';
  </code></pre>
  
  <p>I extracted the texts in quotes but I do not know how to replace the /* and */ with null text.</p>
  
  <pre>
  Sub ReplaceWithRegex()
      Dim strPattern As String
      Dim strReplace As String
      Dim regEx As Variant
      Dim strtxt As String
  
      Set regEx = CreateObject("vbscript.regexp")
      strtxt = "A = 'THIS IS AN ALPHABETIC /* CONSTANT' || WS_CON1 /* */ || ' TEST STRING */';"
      strPattern = "\'([^\']*)\'"
      strReplace = ""
  
      With regEx
          .Global = True
          .MultiLine = True
          .IgnoreCase = False
          .Pattern = strPattern
      End With
  
      If regEx.Test(strtxt) Then
          Debug.Print regEx.Replace(strtxt, strReplace)
      Else
          MsgBox ("Not matched")
      End If
  End Sub
  </pre>
  
  <p>Obviously, this replace all text between quotes to null string.</p>
  
  <p>How do I solve this problem?</p>