###User Defined Function###
_FO_CorrectMask

###Description###
Returns the correct mask for the search for files or folders.

###Syntax###
#Include <FileOperations.au3>
_FO_CorrectMask ( $sMask )

###Parameters###
@@ParamTable@@
$sMask
	Mask contains valid characters in filenames and wildcards "*" and "?" and the delimiter "|"
@@End@@

###ReturnValue###
@@ReturnTable@@
Success:	Returns a correct mask
Failure:	Returns the character "|" and @error=2
@@End@@

###Remarks###
Function corrects possible errors entered by the user:
1. Removes duplicate elements of the mask. For example, <b>*.avi|*.mpg|*.avi</b> is converted into <b>*.avi|*.mpg</b> (only affects the speed of regular expression)
2. This type of mask <b>*|*.avi</b> or <b>*|*NameFolder</b> handles as <b>*</b> - find everything using a larger range.
3. An empty string means <b>*</b> - to search for all files.
4. Duplicate spaces and dots at the end of each element are removed, i.e., <b>*.avi .|*.mpg |*.vob.</b> converted into <b>*.avi|*.mpg|*.vob</b>, because the file/folder name may not end with these characters.
5. Search differs from searching the Explorer, which was originally set up as: <b>*mask*</b>, i.e., any name containing the <b>mask</b>
<b>*</b> - means any number or absence of characters
<b>?</b> - means any single character.

###Related###
_FO_FileSearch, _FO_FolderSearch

###Example###
@@IncludeExample@@