Do you want to use regular expressions (regexp), or just happened to find that line?
If regular expressions are not needed, you can write "+cat,+dog". There are also a help page that describes all searching options, and also there are options (Settings, Advanced tab) that can be used to change behaviour.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, I wasn't clear enough
I was trying to get some hint about regrex format.
Im trying to use with command line.
i want to search file which contains multiple strings
find files only includes both of these strings, string1 and string2
Oh, you are trying to make searches for the content of files, not files names. Such cabapilities are lacking in Locate32 because the main idea of the program is to find file names fast. + and - does not work for the content. It could perhaps be possible to do such searches using regular expression, but I am not familiar with those so well and can't assist that what search term should be used (locate passes regular expressions to PCRE library).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I created 5 test text files containing the strings 'bird,cat,dog,fish'.
Then removed test strings in each file. So that:
bird _,2,3,4,5
cat 1,_,3,4,_
dog 1,2,_,4,_
fish 1,2,3,_,5
cat AND dog should return file 1,4 regexp:
cat OR dog should return file 1,2,3,4 regexp:(cat)|(dog)
cat NOT dog should return file 3 regexp: NOT cat OR dog should return file 5 regexp:
I tried EVERYTHING that I could find (spent 3 hrs on this) and could not get it to work correctly. At one time I got results but my joy was short lived when I realized that they were wrong.
Summary: So far this is NOT possible. According to some RegEx dictates that AND is defaulted so that /ab/ is like saying 'a AND b'. So regexp:[(cat)(dog)] should have worked, but I could not get it to work correctly.
maybe something I could look into but don't get your hopes up.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Searching content from the file is not very educated and is just a very simple algorithm. It does not support logical operations, but regular expressions should work. I am not so familiar with regular expressions but should "cat|dog" work for OR searchers?
Regular expressions are handled by the PCRE library.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "General Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Hello,
Im trying to search multiple text in files.
help file says..
regexp:cat|dog search for 'cat' or 'dog'
this works well.
I need to search with an and operator
ex: 'cat' and 'dog'
what is the correct format to do this.
I tried comma [,] space [ ] but didn't worked.
Thank You
Do you want to use regular expressions (regexp), or just happened to find that line?
If regular expressions are not needed, you can write "+cat,+dog". There are also a help page that describes all searching options, and also there are options (Settings, Advanced tab) that can be used to change behaviour.
View and moderate all "General Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Sorry, I wasn't clear enough
I was trying to get some hint about regrex format.
Im trying to use with command line.
i want to search file which contains multiple strings
find files only includes both of these strings, string1 and string2
locate.exe -i -+ -v -lc:+string1,+string2
locate.exe -i -+ -v -lR:+string1,+string2
may i ask for any advice?
Oh, you are trying to make searches for the content of files, not files names. Such cabapilities are lacking in Locate32 because the main idea of the program is to find file names fast. + and - does not work for the content. It could perhaps be possible to do such searches using regular expression, but I am not familiar with those so well and can't assist that what search term should be used (locate passes regular expressions to PCRE library).
I created 5 test text files containing the strings 'bird,cat,dog,fish'.
Then removed test strings in each file. So that:
bird _,2,3,4,5
cat 1,_,3,4,_
dog 1,2,_,4,_
fish 1,2,3,_,5
cat AND dog should return file 1,4
regexp:cat OR dog should return file 1,2,3,4
regexp:(cat)|(dog)cat NOT dog should return file 3
regexp:NOT cat OR dog should return file 5
regexp:I tried EVERYTHING that I could find (spent 3 hrs on this) and could not get it to work correctly. At one time I got results but my joy was short lived when I realized that they were wrong.
Summary: So far this is NOT possible. According to some RegEx dictates that AND is defaulted so that /ab/ is like saying 'a AND b'. So
regexp:[(cat)(dog)]should have worked, but I could not get it to work correctly.maybe something I could look into but don't get your hopes up.
Searching content from the file is not very educated and is just a very simple algorithm. It does not support logical operations, but regular expressions should work. I am not so familiar with regular expressions but should "cat|dog" work for OR searchers?
Regular expressions are handled by the PCRE library.