Range.Replace(New System.Text.RegularExpressions.Regex... The match includes one or more special or break characters and cannot be replaced

Hi Aspose team,

I know that there were some other incidents for same problem but this is kind of weird.

In my case I am using Regex to make replacement of strings.

If I use

[A-Z][^\\.;]*(Bente)[^\\.;]*

Replacement is done but if I use

[a-z][^\\.;]*(Bente)[^\\.;]*

I am getting error "The match includes one or more special or break characters..."

My text is:

Welcome to RegExr v2.1 by gskinner.com!

Edit the Expression & Text to see maBentetches. Roll over matches or the expression for details. Undo mistakes with ctrl-z. Save Favorites & Share expressions with friends or the Community. Explore your results with Tools. A full Reference & Help is available in the Library, or watch the video Tutorial.

Sample text for testing:
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789 _+-.,!@#$%^&*();\/|<>"'
12345 -98.7 3.141 .6180 9,000 +42
555.123.4567 +1-(800)-555-2468
foo@demo.net bar.ba@test.co.uk
www.demo.com http://foo.co.uk/
http://regexr.com/foo.html?q=bar

Patern is [A-Z][^\\.;]*(Bente)[^\\.;]* or [a-z][^\\.;]*(Bente)[^\\.;]*
Search string is same like Patern and replacement string can be anything.

As regex is with only capital/lower case letter I do not understand how this can be connected with special characters.

Can you please check?

Thanks

Hi Oliver,


Thanks for your inquiry. We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-13046. Our product team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

Hi Oliver,


Thanks for being patient. It is to update you that the problem occurs because Regex with capitals and lowers match different groups. Lowers select group which contains paragraph break characters and such replacement is currently not supported by Aspose.Words.

Best regards,
Hi,

thanks for feedback.
Does this means that you currently does not support this but will in the future or that you do not have plan to support this at all?

It is kind of weird that this does not work as when I use normal Regex it works so to me it looks like Aspose missing something.

Thanks,
Oliver

Hi Oliver,


Thanks for your inquiry. We are in coordination with product team to get answer pertaining to your queries. Soon you will be updated with the required information.

Best regards,

The issues you have found earlier (filed as WORDSNET-13046) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.