Create Search queries that match specified patterns with regular expressions (regex).
The Search app allows up to five regex per query. To use regex, surround the pattern
you want to query with forward slashes (/):
endpointHostName: /^(W|m)/
-
Search supports regex only for the string data type.
-
General Search does not support regex .
-
Use full match to search a file path. Using partial match for file path search generates an error.
-
Add a space before and after forward slashes to avoid syntax errors.
Syntax examples
Query
|
Result
|
Explanation
|
/^(this is a regex)/ |
Error
|
Regex queries must include the field name. Free search is not supported.
|
endpointHostName: /^(W|m)/ |
Returns results
|
Query has correct syntax.
|
filePath: /etc/pwd/config/aaa |
Error
|
Use a backslash (\) to escape each forward slash to avoid syntax errors.
filePath: /\/etc\/pwd\/config\/aaa/ Use quotation marks and wildcards to avoid syntax errors.
filePath: "*/etc/pwd/config/aaa*" This example is not regex.
|
filePath: /\/etc\/pwd\/config\/aaa/ |
Returns results |
Query has backslashes (\) to escape forward slashes.
|