Menu

Wildcard in XPATH

Help
Totya
2025-08-17
2025-08-17
  • Totya

    Totya - 2025-08-17

    Hello!

    In 2.59 I can't find such an option (Find) as "String Name" (I read this on the forum a while ago)

    There is a method in the help that partially works, for example I have an "Email" stringfield, and it finds them (xpath search):

    //Entry/String[(Key = 'Email')]
    

    However, no matter what I do, I can't use a wildcard, how is that possible:

    "*Email*"
    

    Thank you!

     

    Last edit: Totya 2025-08-17
  • Dominik Reichl

    Dominik Reichl - 2025-08-17

    If you want to find all string fields whose name contains the word 'Email', my suggestion would be that you open the 'Find' dialog (via the main menu 'Find' → 'Find...'), enter 'Email' in the 'Find what' field, activate the 'Simple expression' mode and the option 'String name' (in the 'Search in' control group). This works because the 'Simple expression' mode looks for substrings. For details, see the documentation:
    https://keepass.info/help/base/search.html

    If you want to find all string fields whose name is 'Email' (exactly), you could use a regular expression like '^Email$'. With an XPath expression, you can perform more complex searches; see this example:
    https://keepass.info/help/base/search.html#ex_xpe_str_c

    Best regards,
    Dominik

     
    • Totya

      Totya - 2025-08-17

      Thanks for the answer! :)

      I found the "String name" option, I don't know why I didn't see it at first. In "Simple expression" mode, it still didn't find the partial string, then I realized the problem was that it doesn't recognize the * symbol. So it's searching for a partial string by default, which is annoying, it could accept * as well. It doesn't show anywhere in the search window that it's searching for a partial string by default, if it were written there, I wouldn't have to write to the forum and ask. But as I wrote, it could accept * as well, or at least write a warning that * is not needed because it's searching for partial by default.

      I wrote about the XPath full name search in the first post and it works.

      Thank you!

      (google translated)

       
  • Paul

    Paul - 2025-08-17

    I always expect a "search" to be a sub-string (partial) search. The only exception is in an Auto-Type match, where the help says you need to add a wild card for an exact match.

    cheers, Paul

     

Log in to post a comment.

MongoDB Logo MongoDB