Is there a way to use Regex in search?

3 posts, 0 answers
  1. Bekir
    Bekir avatar
    16 posts
    Member since:
    Sep 2010

    Posted 27 Mar Link to this post

    Hello,

    I want to use Regex in search term. PDF files have some accented characters (like a > â) . And the search results do not give the desired result. Is there a way to use Regex in search?

    Best regards...

  2. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 28 Mar Link to this post

    Hello Bekir,

    Thank you for writing.

    You can search by a Regex by setting the TextSearchOptions.UseRegularExpression property to true. Thus, the Find /FindPrevious method will treat the text as a regular expression:
    Telerik.Windows.Pdf.Documents.Fixed.Search.TextSearchOptions options = new TextSearchOptions();
    options.UseRegularExpression = true;
    string pattern = "[aâ]";
    SearchResult result = this.radPdfViewer1.PdfViewerElement.FindPrevious(pattern, options);

    I hope this information helps. Should you have further questions I would be glad to help.

     Regards,
    Dess
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Bekir
    Bekir avatar
    16 posts
    Member since:
    Sep 2010

    Posted 28 Mar Link to this post

    Hello Dess,

    Thank you very much for your interest. This is what I need.

    Regards...

Back to Top