We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Ignore capitalization when using "Replace Text Based on a Regular Expression"

Good morning,


How can I indicate that my regular expression ignore capitalization when using Replace Text Based on a Regular Expression?

Thanks in advance,
Ortal

Hi Ortal,


Thanks for contacting support.

It depends upon the regular expression string which you are using to search the text inside PDF document. However, the regular expression enclosed in (?i) and (?-i), is used to ignore case in the matching string. It would be appreciated if you can share a sample document and a code snippet including regular expression string, which you are trying, so that we can share appropriate feedback after testing the scenario in our environment.


Best Regards,

Hi Ortal,


Thanks for contacting support.

As per my understanding, you need to perform search text in both uppercase and lowercase. If so is the case, then please try using following regular expression.

[C#]
// In order to search a string in either upper case or lowercase, you may consider using regular expression.
textFragmentAbsorber = new TextFragmentAbsorber("(?i)Line", new TextSearchOptions(true));

In case you have different requirement, please share some further details, so that we can reply accordingly.