Using regex in the advanced search duplicates the escape character \

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 7.4.1
    • Component/s: Search - Core
    • None
    • 1
    • Severity 3 - Minor
    • 1

      Issue Summary

      When performing a regex search from the Advanced Search the escape characters are duplicated in the HTML encoded URL. But if you remove the duplicated escape characters from the URL the search works as expected.

      Steps to Reproduce

      1. Add a URL link to a page - http://somewhere.com
      2. Go to advanced search and perform a regex search with this term:
        /.*http\:\/\/somewhere\.com.*/
      3. No pages are found
      4. The encoded URL has duplicated the escape characters in the site search query paramater:
        /dosearchsite.action?cql=siteSearch+~+"%2F.*http%5C%5C%3A%5C%5C%2F%5C%5C%2Fsomewhere%5C%5C.com.*%2F"&queryString=%2F.*http%5C%3A%5C%2F%5C%2Fsomewhere%5C.com.*%2F
      5. Which decodes to:
        /dosearchsite.action?cql=siteSearch ~ "/.*http\\:\\/\\/somewhere\\.com.*/"&queryString=/.*http\:\/\/somewhere\.com.*/
      6. If you remove the duplicated / escape characters from the URL the search works as expected:
        %2Fdosearchsite.action%3Fcql%3DsiteSearch+%7E+%22%2F.%2Ahttp%5C%3A%5C%2F%5C%2Fsomewhere%5C.com.%2A%2F%22%26queryString%3D%2F.%2Ahttp%5C%3A%5C%2F%5C%2Fsomewhere%5C.com.%2A%2F

      Expected Results

      The regular expression finds related content as seen when removing the duplicated escape characters.

      Actual Results

      No content is found.

      Workaround

      Try a more basic regular expression for looking for links, the following example works:

      /.*somewhere.com.*/

            Assignee:
            Unassigned
            Reporter:
            Danny (Inactive)
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: