Range.Replace method Issue | dot net

We are trying to replace placeholder which will be in sqaure bracket, but it seems it is working only for some 200 list of placeholder, and it is escaping other extra placeholder if their count is more than 200. Below is the piece of code where we can see it simply has pattern to match for sqaure bracket .

ange.Replace(new Regex(@"\[[^\]]{2,}?\]+"), "", new FindReplaceOptions(FindReplaceDirection.Backward, someValidations));

@Tanweer Could you please attach your input document here for testing? We will check the issue and provide you more information.
Most likely, the problem occurs because Aspose.Words is used in evaluation mode, i.e. without license. In evaluation mode Aspose.Words limits the maximum size of the processed document to several hundreds of paragraphs. So your document is truncated.
If you would like to test new version of Aspose.Words without evaluation version limitations, you can request a free 30-days temporary license .
Please see our documentation to learn more about licensing:
https://docs.aspose.com/words/net/licensing/

Below is the peice of code and attached the doc as well:

using (var stream = new MemoryStream(blob.Content))
{
    var reader = new SequentialReader(stream);
    reader.Document.JoinRunsWithSameFormatting();
    reader.Document.Range.Replace(new Regex(@"\[[^\]]{2,}?\]+"), "", new FindReplaceOptions(FindReplaceDirection.Backward, someValidations));
}

Text Parameters.docx (14.8 KB)

@Tanweer The problem is not reproducible, the following code makes 300 replacements as expected:

Document doc = new Document(@"C:\Temp\in.docx");
doc.JoinRunsWithSameFormatting();
int replacements = doc.Range.Replace(new Regex(@"\[[^\]]{2,}?\]+"), "replaced");
Console.WriteLine(replacements);
doc.Save(@"C:\Temp\out.docx");

If use Aspose.Words in evaluation mode, the document is truncated and the above code makes 198 replacements.