How to Find Pattern Matches in a table

Our table filter option for "Find Pattern Matches" allows you to keep cell content in rows based on a regular expression pattern. This advanced filter comes in handy if the data you want follows a specific pattern and you would like to remove any data from your table column that does not match.

The regular expression which you provide to this filter needs to follow the PCRE syntax. Some basic examples are shown below which should get you started. For more in-depth information, please have a look at the  PCRE syntax documentation.

Example #1: Find all integer numbers which are between seven and nine digits long 

Example #2: Find all text tokens which consist of two letters followed by a dash symbol and seven digits: 

Next to writing down the actual pattern, a delimiter character needs to be placed at the start and the end of the expression. Common delimiter characters are / or #. 

Instead of defining the character sets like shown in the example above, one can also use specific letters representing character classes (for example, \d is the same as [0-9]). Below we will list the most common PCRE syntax elements.

Base Character Classes 

\w Any “word” character (a-z 0-9 _)
\W Any non “word” character
\s Whitespace (space, tab CRLF)
\S Any non whitepsace character
\d Digits (0-9)
\D Any non digit character
. (Period) – Any character except newline
Meta Characters
^ Start of subject (or line in multiline mode)
$ End of subject (or line in multiline mode)
[ Start character class definition
] End character class definition
| Alternates, eg (a|b) matches a or b
( Start subpattern
) End subpattern
\ Escape character
n* Zero or more of n
n+ One or more of n
n? Zero or one occurrences of n
{n} n occurrences exactly
{n,} At least n occurrences
{,m} At most m occurrences
{n,m} Between n and m occurrences (inclusive)

A great online resource for creating and testing Regular Expressions is Here you can insert your strings and test the expression to ensure it is correct and working.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us