ProWesS fsearch allows you to search for a string in a files. There are many option which allow you to choose which files have to be searched, and how the program has to try to match the string.
Normally, fsearch attempts to find all the occurences of the search string in the files. When a match is found the name of the file, the line number and the line where a match were found are displayed.
If you indicate the first occurence option, then only the first the first occurence in a file is displayed and searching immediately continues with the next file.
When the binary option is indicated, then fsearch will not attempt to display the line where a match was found, but will just display the file name and the offset in the file where the match was found.
You can choose the directory in two ways. If you indicate the current directory with a HIT or press <d>, then you can edit the directory in the window. If you indicate the item with a DO or press <D>, then you can select it in the standard directory select window.
In the window you can also move up in the directory tree by indicating the <- item or pressing <<>.
You can make sure that fsearch does not display all the files in the current directory. This works in the same way as in the standard ProWesS file select window. If you indicate the extensions item than you can enter a file extension (that is, a string which is compared with the end of the filenames). You can enter several alternatives by separating them with a semicolon.
Normally only the files which end in one of the given extensions will be searched. However if the Not item (<n>) is selected, then only the files which do not end in one of the extensions will be selectable. Of couse, all files will be searched if there are mo extensions.
There is a tree option which allows you to choose whether only the files in the current directory have to be used, or whether all the files in all the subdirectories (the directory tree, hence the name) also have to be scanned. This option can also be changed by pressing <t>.
To make sure that fsearch knows what to search for, you have to edit the search string. You can start editing by pressing <s>. If the edline object, you can just type any string you want, or you can use escape codes for some special characters. All escape codes start with a backslash (\).
The escape codes are :
\\ a backslash \n newline character \r carriage return \t tabulate character \x99 character code, given by the hex number \999 character code, given as a decimal number
When you pass a character code, up to the number of digits shown above are used, or less if the next character is no digit. For example to indicate two characters with code 1, you can type \1\1. However, you have to use all the digits when you a character code 1 to be followed by the digit one, as in \0011.
If no extra options are indicated, fsearch will try to find an exact match for the given string, with only differences in case.
When searching in text files, some spaces may be quite long, or a piece of text may be split over several lines. This can be handled by fsearch if you indicate the spaces options (press <p>). This will allow a space in the search string to be matched with a stretch of whitespace characters. So a space has to match a series of at least one character which can be a combination of space, tab, newline and carriage return. If your search string contains two consecutive spaces, it will be reduced to one space.
You can also make sure that the search string has to be word dilimited. This means that the string should be preceded and followed by a character which is not a letter and not a number (e.g. a space or a puctuation mark). Of course the string can also be at the start or end of the file. You can toggle this status by pressing <w>.
When this option has been selected (for example by pressing <c>), then differences in case will also make the match fail.
< Directory Up D Directory Select Window b Binary status c Case Dependant status d Directory Select (edline) e Extensions (edline) f First Occurence status n Not status p Spaces status s Search String (edline) t Tree status w Word status
As could be expected, fsearch is quite configurable.