title: Selenium how to locate element by partial By.Name (in C#)
body: <p>I'm trying to create a function to locate an element by <em>Partial</em> match on "<strong>By.Name</strong>". But I cannot make it working. </p>
  
  <p>I have tried different permutations of regex (as I found it on internet), but not of those works. 
  I.e. this one will not find the element:</p>
  
  <pre><code>*var element = Driver.FindElements(By.ClassName("x-container")).First()
                  .FindElement(By.Name("//*[contains('Price')]"));*
  </code></pre>
  
  <p>And this one will throw compilation error:</p>
  
  <pre><code>*var element = Driver.FindElements(By.ClassName("x-container")).First()
                  .FindElement(By.Name([*='Price']));*
  </code></pre>
  
  <p>If I specify exact match it works fine:</p>
  
  <pre><code>*var element = Driver.FindElements(By.ClassName("x-container")).First()
                  .FindElement(By.Name("RegularPrice"));*
  </code></pre>
  
  <p>Here is my html page:</p>
  
  <pre><code>&lt;tbody class=”x-container”&gt; &lt;tr class="first-row"&gt;    &lt;td class="form-group"&gt;
        &lt;input type="text" name="Name" class="form-control x-name"&gt;
        &lt;span data-validation-for="Name" class="help-block hidden"&gt;&lt;/span&gt;    &lt;/td&gt;    &lt;td class="form-group"&gt;
        &lt;input type="text" name="Color" class="form-control x-color-dropdown" disabled=""&gt;    &lt;/td&gt;    &lt;td class="has-btn-copy-link"&gt;
        &lt;input type="number" name="RegularPrice" class="form-control"&gt;
        &lt;a data-field="RegularPrice" class="btn btn-link btn-copy-field x-copy-to-all"&gt;Copy to all&lt;/a&gt;    &lt;/td&gt;
  </code></pre>