I'm trying to copy an tag, with attributes from one place in my HTML into another place via Regular Expressions in Dreamweaver. Specifically, I would like to take the following code:

```
<i class="icon-camera"></i></td>
<td class="lastName"><a name="smith" class="lbp_secondary" href="http://www.mywebsite.com/contact-us/directory/joe-smith/" rel="nofollow">Smith</a>

```

and do a Find/Replace with Regular Expressions enabled, so that the code is replaced with the following syntax:

```
<a name="smith" class="lbp_secondary" href="http://www.mywebsite.com/contact-us/directory/joe-smith/" rel="nofollow"><i class="icon-camera"></i></a></td>
<td class="lastName"><a name="smith" class="lbp_secondary" href="http://www.mywebsite.com/contact-us/directory/joe-smith/" rel="nofollow">Smith</a>

```

Basically, it's wrapping the tag pair with the same tag used in the next line.

The Find/Replace I've tried so far is:

Find:

```
<i class="icon-camera"></i></td>
<td class="lastName"><a(.*)>(.*)</a>

```

Replace: 

```
<a$1><i class="icon-camera"></i></a></td>
<td class="lastName"><a$1>$2</a>

```

Also, to be clear, I'm trying to do this for about 300 (out of about 450) instances where exists in my HTML. So some sample data to use would look like:

```
<tr>
<td class="photo" style="text-align: center;" align="center"><i class="icon-camera"></i></td>
<td class="lastName"><a name="davis" class="lbp_secondary" href="http://www.mywebsite.com/contact-us/directory/kathy-aldrich/" rel="nofollow">Davis</a></td>
<td class="firstName"><a name="david" class="lbp_secondary" href="http://www.mywebsite.com/contact-us/directory/kathy-aldrich/" rel="nofollow">David</a></td>
<td class="businessPhone">509-555-2353</td>
<td class="emailAddress"><a href="mailto:davidd@mywebsite.com">davidd@mywebsite.com</a></td>
<td class="office">1822</td>
<td class="department">Shipping</td>
</tr>
<tr>
  <td class="photo" style="text-align: center;" align="center"><i class="icon-camera"></i></td>
  <td class="lastName"><a name="allen" class="lbp_secondary" href="http://www.mywebsite.com/contact-us/directory/alan-allen/" rel="nofollow">Allen</a></td>
  <td class="firstName"><a name="alan" class="lbp_secondary" href="http://www.mywebsite.com/contact-us/directory/alan-allen/" rel="nofollow">Alan</a></td>
  <td class="businessPhone">509-555-2027</td>
  <td class="emailAddress"><a href="mailto:alana@mywebsite.com">alana@mywebsite.com</a></td>
  <td class="office">1481</td>
  <td class="department">Marketing</td>
</tr>
<tr>
  <td class="photo" style="text-align: center;" align="center">&nbsp;</td>
  <td class="lastName"><a name="buttons" class="lbp_secondary" href="http://www.mywebsite.com/contact-us/directory/benjamin-buttons/" rel="nofollow">Buttons</a></td>
  <td class="firstName"><a name="benjamin" class="lbp_secondary" href="http://www.mywebsite.com/contact-us/directory/benjamin-buttons/" rel="nofollow">Benjamin</a></td>
  <td class="businessPhone">509-555-2250</td>
  <td class="emailAddress"><a href="mailto:benjamina@mywebsite.com">benjaminb@mywebsite.com</a></td>
  <td class="office">3013</td>
  <td class="department">HR</td>
</tr>
<tr>
  <td class="photo" style="text-align: center;" align="center"><i class="icon-camera"></i></td>
  <td class="lastName"><a name="Lenore" class="lbp_secondary" href="http://www.mywebsite.com/contact-us/directory/luis-lenore/" rel="nofollow">Lenore</a></td>
  <td class="firstName"><a name="luis" class="lbp_secondary" href="http://www.mywebsite.com/contact-us/directory/luis-lenore/" rel="nofollow">Luis</a></td>
  <td class="businessPhone">509-555-2042</td>
  <td class="emailAddress"><a href="mailto:luisl@mywebsite.com">luisl@mywebsite.com</a></td>
  <td class="office">1432</td>
  <td class="department">Support</td>
</tr>

```