title: How can I avoid a specific string pattern from being replaced by Regex.replace ()
body: <p>I have a string like <br/>
      <code>Pakistan, officially the &lt;a href="Page.aspx?Link=Islamic Republic of Pakistan"&gt;Islamic        Republic of Pakistan&lt;/a&gt;</code></p>
  
  <p>Now I am using<br>
      <code>System.Text.RegularExpressions.Regex.Replace(inputText, "(\\bPakistan\\b)", "something");</code>
  to replace Pakistan outside the  tags. But I don't want to replace Pakistan occurring within the <code>&lt;a&gt;&lt;/a&gt;</code> tags. <br/>
  Edit: an actual string</p>
  
  <blockquote>
    <p>Pakistan (Urdu: پاکِستان), officially
    the Islamic Republic of Pakistan, is a
    country in South Asia. It has a
    1,046-kilometre (650 mi) coastline
    along the Arabian Sea and Gulf of Oman
    in the south and is bordered by
    Afghanistan and Iran in the west,
    India in the east and China in the far
    northeast.[6] Tajikistan also lies
    very close to Pakistan but is
    separated by the narrow Wakhan
    Corridor.</p>
  </blockquote>
  
  <p><br/>
  And An array of strings </p>
  
  <pre><code>string[] links={"Pakistan","Islamic Republic","Republic of Pakistan","South Asia","Arabian Sea","Gulf","Oman","Gulf of Oman","the south","in the south","Afghanistan","Iran","the west","in the west","west India","the east","China","Tajikistan","the narrow","Wakhan Corridor","Central Asia","the Middle","Middle East","the Middle East"}
  </code></pre>
  
  <p>I want to replace every occurrence of every string in this array with <code>&lt;a href="page.aspx?link=thisString"&gt;thisString&lt;/a&gt;</code>. and I could not correctly add links to strings like "Republic of Pakistan" where Pakistan is also another string in this array.</p>