Forum Discussion

Phil_M's avatar
Phil_M
New Contributor
9 years ago

Regular Expressions are not working properly in Find

I am using TestComplete 10.60.3387.7 writing in JScript.

 

When I do a Find All to search a document using match case and regular expressions, the search results do not match my search.  '\w' will match more than one character, as if it is '\w+'.  '\W' does not match anything.  '[^\w]' will match any character, word or not.  '[^a-zA-Z0-9_]' works as expected, the way '[^\w]' should work according to the Help.

 

This issue exists both before and after the patch for TestComplete losing focus on Find.  This all worked properly in version 9.31.

3 Replies

    • Phil_M's avatar
      Phil_M
      New Contributor

      If you had the following script:

       

      var strGuest = "Name";

      var strGuestPassword = "My name is guest";

       

      If you try to do a Find (from menu "Edit > Find" or keyboard "Ctrl + F") and enable regular expressions and match case, "strGuest\w" will find "strGuestPassword" instead of "strGuestP".  If you search for "strGuest\W", it will find nothing instead of "strGuest ".

      • joseph_michaud's avatar
        joseph_michaud
        Moderator

        I must confess that I don't see it.  For me, 'strGuest\w' finds "strGuestP" and 'strGuest\W' finds "strGuest " in both versions of TestComplete.