title: How to Use Regular Expression in XPATH in XML in QTP
body: <p>I am facing a issue in QTP, i have to select a node value using regular expressions in XML</p>
  
  <p>My Xml outputs the code as shown below</p>
  
  <pre><code> &lt;MessageElements xmlns=""&gt;
     &lt;MessageStatus&gt;FAIL&lt;/MessageStatus&gt;
       &lt;ErrorList&gt;
         &lt;ErrorCode&gt;1951&lt;/ErrorCode&gt;
         &lt;ErrorMessage&gt;No Data Found&lt;/ErrorMessage&gt;
         &lt;ErrorStatus&gt;F&lt;/ErrorStatus&gt;
         &lt;ErrorText&gt;OSSDataNotFoundError&lt;/ErrorText&gt;
      &lt;/ErrorList&gt;
      &lt;MessageAddressing&gt;
         &lt;from&gt;ICL&lt;/from&gt;
         &lt;to&gt;ICL SOAPTester&lt;/to&gt;
         &lt;relatesTo/&gt;
         &lt;messageId&gt;12345&lt;/messageId&gt;
         &lt;action&gt;SearchResource&lt;/action&gt;
         &lt;timestamp&gt;2008-09-29T07:19:45&lt;/timestamp&gt;
         &lt;transactionId&gt;1234&lt;/transactionId&gt;
         &lt;ServiceName&gt;SearchResource&lt;/ServiceName&gt;
         &lt;ServiceVersion&gt;2.0&lt;/ServiceVersion&gt;
       &lt;/MessageAddressing&gt;
    &lt;/MessageElements&gt;
  </code></pre>
  
  <p>Here if you observe the second line of the XML, we have <code>MessageStatus</code> but sometimes I get <code>messageStatus</code>.</p>
  
  <p>I want to handle this situation with a single XPath so that if lowercase tag or uppercase tag <code>MessageStatus</code> appears it should match and return the value.</p>
  
  <p>My code for Retrieving the value is as below</p>
  
  <pre><code>Set ObjXml = Createobject("Microsoft.XMLDOM")
  </code></pre>
  
  <p><strong>Case 1</strong></p>
  
  <pre><code>Set ObjNode=ObjXml.SelectSingleNode("/soap:Envelope/soap:Body/*/MessageElements/.*essageStatus")
  ResultText=ObjNode.text
  </code></pre>
  
  <p><strong>Case 2</strong></p>
  
  <pre><code>Set ObjNode=ObjXml.SelectSingleNode("/soap:Envelope/soap:Body/*/MessageElements/[m|M]essageStatus")
  ResultText=ObjNode.text
  </code></pre>
  
  <p><strong>Case 3</strong></p>
  
  <pre><code>Set ObjNode=ObjXml.SelectSingleNode("/soap:Envelope/soap:Body/*/MessageElements//wsageStatus")
  ResultText=ObjNode.text
  </code></pre>
  
  <p>But none of them worked, please help me.</p>