Regex does not find text because of shape object character

Hi Team!

After I updated Aspose.Words 23.1.0 to 23.3.0 version I noticed the following issue.

I have a regex that will match on the following text 123-45-6789. This text is represented by two Run Node, between this two Run there is an Image Shape node:


In 23.1.0 there is no problem to find this text with the following regex: \d{3}-45-6789
If I update to 23.3.0 the text not found with the regex above but if I change to this \d{3}(.)-45-6789 the text found and it is contain an extra character. Match.Value: 123-45-6789

This is the extra character: UTF-16 Encoding: 0xE019

Is this a bug or there are any possible way(field in FindReplaceOptions) to skip these shape characters during Range.Replace?

Here is a sample project to reproduce the issue: (1.5 MB)

Thank you for your help!

@erdeiga The behavior has been changed after WORDSNET-24701 in 23.2 version of Aspose.Words. The current Aspose.Words behavior is closer to MS Word find/replace behavior when there is a shape between the text.
We will consider adding an option to use old Aspose.Words behavior.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-25115

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

The issues you have found earlier (filed as WORDSNET-25115) have been fixed in this Aspose.Words for .NET 23.5 update also available on NuGet.