You are on page 1of 12

Application of Regular

Expression in Search Engine


Optimization
21Blc1342 | Devanshu Agarwal
Index
What are Regular Expressions?
Few symbols used in Regular Expressions
What is Search Engine Optimization?
Uses of Search Engine Optimization?
Why Is Regular Expressions important for Search Engine Optimization?
Real World Uses of Regular Expressions in Search Engine Optimization?
 a) Using Regular Expressions on Google Analytics.
 b) Using Regular Expressions in Google Search Console.
Precautions while using Regular Expressions in SEO
What are Regular Expressions?
A Regular Expression is a sequence of characters that specifies a search pattern in text.
It also offers a declarative way to express the pattern of any string we want to accept.
Regular Expression techniques are developed in theoretical computer
science and formal language theory. The concept of Regular Expressions began in the
1950s, when the American mathematician Stephen Cole Kleene formalized the concept
of a regular language.
They came into common use with Unix text-processing utilities. Usually such patterns
are used by string-searching algorithms.
Regular Expressions are used in search engines, search and replace dialogs of word
processors and text editors, in text processing utilities, lexical analysis, etc.
Most general-purpose programming languages support Regex capabilities either
natively or via libraries.
Few symbols used in Regular Expressions
The Asterisk Symbol ( * ): Optional Character ( ? ):
Matches the preceding characters for 0 Preceding character may or may not
or more times (Upto Infinity). be present in the string to be matched.
The Plus Symbol ( + ): The Caret ( ^ ):
Repeats the preceding characters for at Match must start at the beginning of
least one or more times (Upto Infinity). the string or line.
The Curly Braces {…}: The Dollar ( $ ):
Repeats the preceding characters for Match must occur at the end of the
as many times as the value inside this string or before \n at the end of the
bracket. line or string.
Wildcard ( . ): Vertical Bar ( | ) :
The dot symbol can take place of any Matches any one element separated
other symbol. by the vertical bar (|) character.
What is Search Engine Optimization?
Search Engine optimization is the process of improving the quality and quantity
of website traffic to a website or a web page from Search Engines. SEO targets
unpaid traffic rather than direct traffic or paid traffic.
As an Internet marketing strategy, SEO considers how search engines work, the
computer-programmed algorithms that dictate search engine behavior, what
people search for, the actual search terms or keywords typed into search
engines, and which search engines are preferred by their targeted audience.
SEO is performed because a website will receive more visitors from a search
engine when websites rank higher on the search engine results page (SERP).
These visitors can then potentially be converted into customers.
Uses of Search Engine Optimization?
The Primary use of SEO is to provide for the need of relevant content.
Search engine optimization applies not only to online content, but to websites
or web pages in their entirety. It generally refers to a strategic process in which
an SEO specialist takes appropriate steps to improve site visibility in search
results produced by search engines such as Google and Bing.
In other words, it can be seen as a combination of efforts on your part to
compete favorably in search engine result rankings. The importance of search
engine ranking becomes particularly glaring when you take into serious
consideration the fact that the average web surfer does not typically exude a
great deal of patience.
Why Is Regular Expressions important for Search
Engine Optimization?
With the use of Regular Expressions, Search Engines are able to provide relevant
content as per the request given in by the user.
Regex can be used to explore the queries different user segments use, which
queries are common to specific content areas, which queries drive traffic to
specific parts of your site, and more.
Large-scale data analysis (such as server logs), computer programming and
search & replace operations are a few more tasks which can be achieved by
Search Engines using Regular Expressions.
Real World Uses of Regular Expressions in Search
Engine Optimization?

Regular Expressions are used in several areas during Search Engine Optimization. The
following are a couple of major real world use cases:

a) Using Regular Expressions on Google Analytics.

b) Using Regular Expressions in Google Search Console.

We will look into these real world uses cases in the following slides.
a) Using Regular Expressions on Google Analytics.
One of the most common uses of Regex for SEO is in Google Analytics, where
Regular Expressions can be used to set up filters so that you only see the
data you want to see.
In this sense, the expression is used to exclude results, rather than to
generate a set of inclusive search results. For example, if you want to exclude
data from IP addresses on your local area network, you might filter out
192.168.*.* to remove the full range from 192.168.0.0 to 192.168.255.255.
For Universal Analytics, Regular Expressions can also be used to create
custom dimensions, create custom groupings and ‘or’ & ‘and’ expressions.
b) Using Regular Expressions in Google Search Console.
One of the most interesting use of Regex for SEO is to filter Google Search
Console Performance report.
In Google Search Console, you can use Regular Expressions to filter query or
pages that match or doesn’t match the Regex patterns that you define. This is
pretty powerful to dig into your queries to identify questions user may ask, find
long tail queries or to find potentially duplicate URLs.
Examples you can use in Search Console can be filtering for queries containing
a specific brand and the variations users could type, such as Facebook:
.*facebook.*|face*book.*|fb.*|fbook.*|f*book.*

Filter out users finding your website through “commercial” intent terms:
.*(best|top|alternate|alternative|vs|versus|review*).*
Precautions while using Regular
Expressions in SEO
A poorly written Regex can quite easily filter out most or all of your data by
including an unrestricted wildcard match. The good news is that in many SEO
cases, the filter is only applied to your data at the reporting stage, and by editing
or deleting your Regex, you can restore full visibility to your data.
You can also test Regular Expressions on a number of online testing tools, in
order to see if they achieve the intended outcome – allowing you to ‘sandbox’
your regex expressions before you let them loose across your entire data set.
Thanks

You might also like