7 Replies Latest reply: Nov 10, 2008 10:44 PM by 807589 RSS

    regular expression html parsing

    807589
      I have following sample html
      <html><body>
      First Name<input type="text" class="txtField" name="txtFirstName"\>
      Last name
      <input type="text" name="txtLastName"\>
      Address <textarea name="address" rows="10">Here goes address</textarea>
      <input type="button" name="btnSubmit" class="button"\>
      </body></html>

      I m trying to build a regular expression in such a way that, the expression should find a list of tags based on the set of names available.
      for e.g. I have string array as String names[] = {"txtLastName", "address"}

      using above array, the expression must find tag in above html.

      So in above case the output should be
      <input type="text" name="txtLastName"\>
      <textarea name="address" rows="10">

      Can somebody suggest how this expression should be build?