Change language settings to use Topvisor in your preferred language. You can select and set a preferred display language later in the Account settings. Change language settings to use Topvisor in your preferred language. ru Русский Apply

Regular expressions

You can use comparison operators to search and filter keywords, but sometimes they are not enough. For advanced search use regular expressions.

What is a regular expression

Regular expression is a sequence of characters that define a search pattern. Such patterns are used by string searching algorithms for "find" or "find and replace" operations, or for input validation.

How to use regular expressions

You can use regular expressions on the following pages: Keywords (Advanced mode) and Rank Tracker.

How to use regular expressions on the Keywords page:
  1. Move to the Keywords (Advanced mode) page.
  2. Select all keywords or a keyword group in the left menu.
  3. Press (or double-click a title).
  4. Type a regular expression in the selected column.
  5. Press Enter.
Regular expressions. Keywords
How to use regular expressions on the Rank tracker page:
  1. Move to the Rank tracker page.
  2. Press .
  3. Type a regular expression.
  4. Press Enter.
Regular expressions. Rank tracker

Regular expressions syntax

Most characters in regular expressions are interpreted literally. It means that an expression 'abc' would match letters a, b and c. However, there's a group of special characters that match special conditions: the beginning and the end of line, any number or any character, etc. To escape a special character, put a '\' before it.

Important!
You should write all regular expressions between '/' characters.

Special character Legend Example Structure Comment
. Any character /^.ill$/ ^ — start of keyword
. — any character
ill — letters that should be after the first character
$ — end of keyword
Search 4-letter keywords that start with any character and end with 'ill', for example, 'bill', 'fill', 'hill', 'mill', 'pill'.
^ Start of keyword /^а/ ^ — start of keyword
а — search character
Search all keywords that start with 'a'.
$ End of keyword /^free$/ ^ — start of keyword
free — search keyword
$ — end of keyword
Search the phrase specified in a regular expression only, skip all keywords that contain the phrase.
* Matches a preceding character 0 or more times /^t.*r$/ ^ — start of keyword
t, r — characters in the beginning and the end of keyword
.* — zero or more characters
$ — end of keyword
Search all keywords that start with 't' and end with 'r'. Zero or more characters can be between the first and the last character.
+ Matches a preceding character 1 or more times /^t.+r$/ ^ — start of keyword
t, r — characters in the beginning and the end of keyword
.+ — one or more characters
$ — end of keyword
Search all keywords that start with 't' and end with 'r'. At least one character should be between the first and the last character (a keyword 'tr' will be skipped).
? Matches a preceding character 0 or 1 time /a\s?lot/ a, lot — search keywords
\s — whitespace
\s? — whitespace between keywords is optional
Search all keywords with the words 'a' and 'lot' that are separated or not by whitespace.
| OR operand. Matches expression before or after character /buy|free/ buy, free — search keywords
| — OR operand
Search phrases with the word 'buy' or with the word 'free' or with both words.
! Exclude phrase !/free/ ! — use the character to exclude words
results with a word 'free' will be discarded
Search keywords without a word 'free'.
{ } Character is repeated a certain number of times
{n} — repeated n times
{n,} — repeated n times or more
{n,m} — repeated from n to m times inclusive
/^.{3,10}$/ ^ — start of keyword
. — any characters
{3,10} — how many times a character should be repeated
$ — end of keyword
Search keywords that are from 3 to 10 characters (including whitespaces).
[ ] Any of the characters in square braces or their range. If the first character of the expression is ^, all results with the characters in the braces will be discarded /^[1-5]$/ ^ — start of keyword
[1-5] — search a range
$ — end of keyword
Search keywords with Search Volume from 1 to 5 inclusive (apply the expression to the Search Volume column).
( ) Grouping of expressions /(^|\s)а/ (^|\s) — search character is in the beginning or in the middle (after whitespace)
а — search character
Search phrases where at least one word begins with 'a' character.
\ Escaping special characters /\+/ \+ is a '+' character that will be interpreted literally Search keywords with a '+' character.

Related links