# REGEX: Scan for a string based on Regular Expression pattern

Use the REGEX formula function in a query-based view filter or a table view threshold for the text or timestamp that matches a pattern. The pattern is based on a regular expression.

- Scan for a string based on Regular Expression pattern
- The REGEX function looks for a pattern match to the expression. The operators
available are specific to the
*regular expression*syntax. Search for "regex" or "regular expression" in your browser to find links to more information (such as this topic in the developerWorks® technical library). - Text example
- This formula for the Windows event log table view threshold highlights
a cell if the event type is at least three letters long but no longer
than nine. Thus, the event types
*Error*and*Warning*are highlighted but not*Information*.`REGEX(Type) == '[A-Za-z]{3,9}'`

- Time example
- This formula begins looking at the seventh character, the year,
to find 10, so a timestamp of
*06/12/10 09:29:05*would meet the criteria, but*01/20/09 11:07:05*would not.`REGEX(Timestamp) == 7,10`

- Operators
- The regular expression capability in the Filters and Thresholds
tabs of the Properties editor enables you to perform very specific
searches through many rows of data based on a pattern. This table
has a list of commonly used operators in regular expressions.
Operator Description . period Match any single character ^ caret Match the empty string that occurs at the beginning of a line or string $ dollar sign Match the empty string that occurs at the end of a line A Match an uppercase letter *A*a Match a lowercase letter *a*\d Match any single digit \D Match any single nondigit character \w Match any single alphanumeric character; a synonym is [:alnum:] [A-E] Match uppercase *A, B, C, D*, or*E*[^A-E] Match any characters except uppercase *A, B, C, D*, or*E*X? Match none or one capital letter `X`

X* Match any number of capital *X*esX+ Match one or more capital *X*esX{n} Match exactly *n*capital*X*esX{n,m} Match at least *n*and no more than m capital*X*es; if you omit*m*, the expression tries to match at least*n**X*es(abc|def)+ Match a sequence of at least one *abc*and*def*;*abc*and*def*would match