Windows 10: Windows Syntax & Search

Discus and support Windows Syntax & Search in Windows 10 Support to solve the problem; Hi! . I want to search for strings that occur within the contents of text files. . I am definitely missing something with respect to Windows'... Discussion in 'Windows 10 Support' started by razam, Feb 10, 2018.

  1. razam Win User

    Windows Syntax & Search


    Hi!
    .
    I want to search for strings that occur within the contents of text files.
    .
    I am definitely missing something with respect to Windows' search syntax or Windows in general...sorry!
    .
    To avoid the complexity of my specific issue, I created the following test scenario.
    .
    1) I created a file called test.txt on my Desktop
    .
    2) I entered the string "abc123abc" in test.txt
    .
    3) I double checked that test.txt is indexed...it IS
    ....a) I deleted and rebuilt my index database
    ....b) I double checked that test.txt is indexed again...it IS again
    .
    4) I attempted to search, unsuccessfully, for test.txt
    ....a) My search strings are
    ........i) not "test"
    ........ii) "abc"
    ........iii) "123"
    ........iv) "*abc*"
    ........v) "*123*"
    ........vi) "?abc?"
    ........vii) "?123?"
    .
    I really do not understand what I am missing.
    .
    Please help!
    .
    Thanks,
    Mark
    .
    PS: Those dots everywhere are to counter this forum's automatic white space edit.

    :)
     
    razam, Feb 10, 2018
    #1

  2. Searching for Phrase in File Explorer

    You may have noticed that there is a link in that help page that Ron showed you to a reference for Advanced Query Syntax. Unfortunately it redirects uselessly now so you need to find a new one based on that hint.

    Using Advanced Query Syntax Programmatically (Windows)

    (BING search for

    advanced query syntax search windows phrase wildcard

    )

    Looks like the search syntax you might want to be trying is $="search for a phrase" However, I think you could also try the DOSWILDCARD syntax ~"search for a phrase" -- just make sure you don't need any questionmarks or asterisks in your "phrase".
    ; )



    Good luck

    Robert Aldwinckle

    ---
     
    Robert Aldwinckle on forums, Feb 10, 2018
    #2
  3. Search Query Syntax?

    Is there any documentation pertaining to the Windows Photos App search box query syntax? Something like this: Advanced
    Query Syntax
    ?

    I tried something like: date:2016 and it yields results for photos taken in 2016. Searching:
    camera:canon causes the photos app to close abruptly (crashes).

    [Moved from:
    Windows / Apps on Windows 10 / Photos]
     
    José Oliver-Didier, Feb 10, 2018
    #3
  4. Kari Win User

    Windows Syntax & Search

    Search for a file containing a specific string in file contents:

    contents:string

    Search for a file with two specific strings in file contents:

    contents:string1 AND contents:string2

    Search for a file with at least one of three specific strings in file contents:

    contents:string1 OR contents:string2 OR contents:string3

    Search for a file with one of two specific strings in file contents, excluding files which also have a spefic string:

    contents:string1 OR contents:string2 NOT contents:string3

    Note that logical operators AND, OR, NOT must be given in all uppercase.
     
  5. razam Win User
    Thank you for your reply Kari.
    .
    Please help me understand another detail.
    .
    When I enter into the search text box, the following strings,
    ...."contents:abc"
    ........I find test.txt
    ...."contents:123"
    ........I do not find test.txt
    ...."contents:*abc*"
    ........I find test.txt
    ...."contents:*123*"
    ........I do not find test.txt
    ...."contents:?abc?"
    ........I find test.txt
    ...."contents:?123?"
    ........I do not find test.txt
    .
    Why do I not find test.txt when searching for "contents:123", "contents:*123*", and "contents:?123?" while I do find test.txt when searching for "contents:abc", "contents:*abc*", and "contents:?abc?" ?
    .
    Thanks,
    Mark
     
    razam, Feb 10, 2018
    #5
  6. Kari Win User
    Add double tilde (~~) to search a partial string within a string:

    contents:~~123

    Without two tildes, the partial string you are searching for must be at the beginning of the string. Double tilde tells it can be located within a longer string.
     
  7. razam Win User
    With respect, I still do not understand because my searches for both

    contents:~~abc

    and

    contents:~~123

    fail to find test.txt.

    Is there documentation regarding Windows syntax that you can refer me too?

    Thanks,
    Mark
     
    razam, Feb 10, 2018
    #7
  8. Kari Win User

    Windows Syntax & Search

  9. dalchina New Member
    Hi, it seems the difficulty is that you must specify text from the start of the string.

    The question is discussed here:
    File Explorer how to search content using wildcards


    Neither * nor ? are recognised as wild card characters in content search- * seems to be ignored.
    (They are valid for filename search though).

    What works (for me!)
    abc*
    abc
    abc123

    Note that
    *abc finds the file, which might suggest
    *3abc would, but it doesn't.

    What doesn’t work:
    *123abc
    ???123*
    ???123???
    123abc
    abc*abc

    Advanced Query Syntax gives a lot of information, but is old and not complete.
    Even 'How to Geek' only gives a simple example of text content search
    Learning Windows Search: Use Boolean, Dates, and Wildcards to Give Your Searches a Boost

    3rd party tools are just simpler.. even if they don't index content like this one:

    Windows Syntax & Search [​IMG]

    Here I started from 'Everywhere' (both disks), specified txt documents containing 123abc

    The result was fairly quick.
     
    dalchina, Feb 11, 2018
    #9
  10. razam Win User
    Thanks for your help. I decided to use Notepad++ and/or Grep for Windows.
     
    razam, Apr 5, 2018
    #10
Thema:

Windows Syntax & Search

Loading...
  1. Windows Syntax & Search - Similar Threads - Syntax Search

  2. What is the correct syntax to search a date range for all Windows 11 updates in the MS...

    in Windows 10 Gaming
    What is the correct syntax to search a date range for all Windows 11 updates in the MS...: What is the correct syntax to search a date range for all Windows 11 updates in the MS update catalog search window. I cannot find anywhere with the wildcards?I am trying to update an offline Windows 11 computer that has not been update since 8/2023 so i need 8/23 - 2/24...
  3. What is the correct syntax to search a date range for all Windows 11 updates in the MS...

    in Windows 10 Software and Apps
    What is the correct syntax to search a date range for all Windows 11 updates in the MS...: What is the correct syntax to search a date range for all Windows 11 updates in the MS update catalog search window. I cannot find anywhere with the wildcards?I am trying to update an offline Windows 11 computer that has not been update since 8/2023 so i need 8/23 - 2/24...
  4. Search syntax to find *.blend excluding *.blend111

    in Cortana
    Search syntax to find *.blend excluding *.blend111: Blender appends a number to .blend for each backup file. I want to find the "master" *.blend file, while not finding *.blend1 , *.blend11 , *.blend111 etc.Help with the syntax please?...
  5. Search syntax to find *.blend excluding *.blend111

    in Windows 10 Gaming
    Search syntax to find *.blend excluding *.blend111: Blender appends a number to .blend for each backup file. I want to find the "master" *.blend file, while not finding *.blend1 , *.blend11 , *.blend111 etc.Help with the syntax please?...
  6. Search syntax to find *.blend excluding *.blend111

    in Windows 10 Software and Apps
    Search syntax to find *.blend excluding *.blend111: Blender appends a number to .blend for each backup file. I want to find the "master" *.blend file, while not finding *.blend1 , *.blend11 , *.blend111 etc.Help with the syntax please?...
  7. syntax for searching for text within a particular file type

    in Cortana
    syntax for searching for text within a particular file type: Hello. I want to find specific text within a file type with extension .RSpecifically, for exampleI tried a search like this:NCNA.tib ext:"R" and the resulting file does not show upa search like ext:"R" works and brings up all the R filesFurther, if I click on one of those...
  8. What is the syntax of search strings in File Explorer's search box?

    in Windows 10 Network and Sharing
    What is the syntax of search strings in File Explorer's search box?: File Explorer has a search box in the upper right. If I type the string ~* then it doesn't just search for filenames starting with tilde. Somehow I found that I can type file:~"*~*" and it finds all filenames containing a tilde. But tomorrow I might want to search for...
  9. Wat is the syntax of search strings in File Explorer's search box?

    in Windows 10 Network and Sharing
    Wat is the syntax of search strings in File Explorer's search box?: File Explorer has a search box in the upper right. If I type the string ~* then it doesn't just search for filenames starting with tilde. Somehow I found that I can type file:~"*~*" and it finds all filenames containing a tilde. But tomorrow I might want to search for...
  10. Windows 10 ver 2004 Search Syntax Parameters Removed?

    in Windows 10 Ask Insider
    Windows 10 ver 2004 Search Syntax Parameters Removed?: Hello, I use search syntax parameters in windows explorer search bar such as datemodified: or datecreated: on a daily basis. Were these removed in the 2004 update? I checked the 'removed features' of the 2004 update but I'm not seeing anything about search. Thank you...