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

Free Support Forum - aspose.com

Regex issue

Hi,



I’m trying to find text in a pdf based on Regex.

I want to find any string that a specific word appears in. Let say the word is test, so I pass textFragmentAbsorber = new TextFragmentAbsorber("/test/");

The result is that it doesn’t find anything. I did set TextSearchOptions textSearchOptions = new TextSearchOptions(true);

Can you please help?

Hi Tzach,


Thanks for contacting support.

In case you need to search the word Test in both upper-case and lower-case, you may consider using following code line

//create TextAbsorber object to find all instances of the input search phrase<o:p></o:p>

TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber("(?i)(T|t)overage");


In case you still face any problem, please share the resource PDF file so that we can test the scenario at our end.

@tkaufmann,

I like to inform that we have new feature available now which is based on .NET regex object. Please check release notes link.