Question: I'm looking for a RegEx expression that replaces entire word with \*\*\* IF they contain a digit, but only IF the word is more than 2 characters. For example,

The boy cried w0lf aga1n for 2 days in row! 12 12345

Would read as 

The boy cried \*\*\*\* \*\*\*\*\* for 2 days in a row! 12 \*\*\*\*\*

For finding words with a digit, the following expression seems to work:

```
[a-z]*\d+[a-z]*

```

But I would like a solution that only finds words with greater with length greater than 2.

Answer: 
The Tally XML structure is as follows :

**To Import data into Tally** 

```
<ENVELOPE>
  <HEADER>
    <TALLYREQUEST>Import Data</TALLYREQUEST>
  </HEADER>
  <BODY>
    <IMPORTDATA>
      <REQUESTDESC>
        <REPORTNAME>All Masters</REPORTNAME>
      </REQUESTDESC>
      <REQUESTDATA>
        <TALLYMESSAGE xmlns:UDF="TallyUDF">
          <!-- Your data goes here -->
        </TALLYMESSAGE>
      </REQUESTDATA>
    </IMPORTDATA>
  </BODY>
</ENVELOPE>

```

Remarks:  

As you can see, the data to be pushed into Tally has to be written in the `TALLYMESSAGE` tag.

**To Export data from Tally** 

```
<ENVELOPE>  
  <HEADER>  
    <TALLYREQUEST>Export Data</TALLYREQUEST>  
  </HEADER>  
  <BODY>  
    <EXPORTDATA>  
      <REQUESTDESC>  
        <!-- Specify the Report Name here -->  
        <REPORTNAME>List of Accounts</REPORTNAME>  
        <STATICVARIABLES>  
          <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>  
        </STATICVARIABLES>  
      </REQUESTDESC>  
    </EXPORTDATA>  
  </BODY>  
</ENVELOPE>  

```

Remarks:  

The report or data to be retrieved from Tally is to be given in the `REPORTNAME` tag.

There are many reports in Tally ERP 9. The XML tags to retrieve / export data from Tally are given here :  

<https://www.rtslink.com/articles/tally-xml-tags-export/>

Similarly XML tags to Import data into Tally are given here  

<https://www.rtslink.com/articles/tally-xml-tags-import/>

Hope the above resources helps those who wish to integrate with Tally.
As per the [reference guide](http://mirror.tallysolutions.com/tallyweb/tally/td9/Tally.ERP9_Integration_Capabilities.pdf), there are 3 types of requests:

1. Export
2. Import
3. Execute

You can use any of these within the 'TALLYREQUEST' xml tag. Of course, there's a lot more information you'd have to put in to create a complete XML request, and all the details are in the guide. For example, the following exports a list of all masters from Tally:

```
<ENVELOPE>
    <HEADER>
        <VERSION>1</VERSION>
        <TALLYREQUEST>EXPORT</TALLYREQUEST>
        <TYPE>DATA</TYPE>
        <ID>All masters</ID>
    </HEADER>
    <BODY>
        <DESC>
        </DESC>
    </BODY>
</ENVELOPE>

```