I am designing by code a report sent by email with Outlook using HTML format.

To do that, I'm loading first a HTML template where I can insert all dynamic parts using predefined tags like **[CustomerName]**.

```
<p>You will find below reports for customer [CustomerName] dated [ReportdDate]</p>

<tag-1>
<h3>TableTitleA</h3>
<table>
  <thead id="t01">
    <tr>
        <th align='center' width='80'>Order Nr</th>
        <th align='left' width='400'>Date</th> 
        <th align='left' width='200'>Info</th> 
        <th align='center' width='200'>Site Name</th> 
    </tr>
  </thead>
  <tbody>
    [TableA]
  </tbody>
</table>
</tag-1>

<tag-2>
<h3>TableTitleB</h3>
<table>
  <thead id="t01">
    <tr>
        <th align='center' width='80'>Order Nr</th>
        <th align='left' width='100'>Date</th> 
        <th align='left' width='400'>Info</th> 
        <th align='left' width='200'>Site Name</th> 
    </tr>
  </thead>
  <tbody>
    [TableB]
  </tbody>
</table>
</tag-2>

<p>Best regards</p>

```

This template is ready to insert two HTML tables: **[TableA]** and **[TableB]**

But sometimes a table has no data. So, I want to remove that complete HTML section. To achieve this, I have inserted fake tags:

```
<tag-1></tag-1> and <tag-2></tag-2>

```

And then removing the complete section including the two fake tags using TRegEx. This is working just fine here:

<https://regex101.com/r/5OFlyC/1>

But with this code in Delphi, it doesn't work as expected:

```
TRegEx.Replace(MessageBody.Text, '<tag-1>.*?</tag-1>', '');

```

Could you tell me what's wrong here?

My problem is fixed. Thanks to all of you