Regex is abbrevation for regular expressions. Regex are special charactres that match or capture the portion of field, as well as rule that govern the all characters. In Google Analytics you can use the Regex to create filters, to create a Goal and fine-tune the funnel steps. Regular Expression is about "Power Matching". For example if you want to create a goal that matches multiple "thank you" pages that is power matching.
One of the important Regex characters is
The Backslash (\)
A backslash escape the character, means it turns the Regular Expression characters (.,|, ?, [ ], *, +,(), ^, $ ) into a plain text. Backslash widely used in Regex. Before going into detail lets understand what is plain text, strings and targetd string.
Plain Text means not Regular Expression Text
String means any assembly of character. A world can be string, space, sentence, a url can be a string.
Target String means the strings you are tring to match with your regex.
Lets understand how Backslash works, suppose sitename.com/folder?toy=231 is your Goal page. In this example ., ? are regex so we want to make them a plain text. We can do this by using backslash as
sitename\.com/folder\?toy=231
Where we can use Backslash ?
We can use Backslash (\) in Filters. For example in search and replace filter we can use this as Search string and can replace this as Replace string.
To exclude the I.P. addresses
We can use the Backslash to exclude the I.P. addresses of company. Suppose you want to exclude all IP addresses of your company. For example you have IP addresses from 122.163.202.83 to 122.163.202.93 the Regex for this will be
^122\.163\.202\.(8[3-9]|9[0-3])$
In this example some other regex are also used, but you can get the regex for IP addresses by using Google regex tool. In my next posts i will discuss about the other Regex, so please keep visiting my blog.
One of the important Regex characters is
The Backslash (\)
A backslash escape the character, means it turns the Regular Expression characters (.,|, ?, [ ], *, +,(), ^, $ ) into a plain text. Backslash widely used in Regex. Before going into detail lets understand what is plain text, strings and targetd string.
Plain Text means not Regular Expression Text
String means any assembly of character. A world can be string, space, sentence, a url can be a string.
Target String means the strings you are tring to match with your regex.
Lets understand how Backslash works, suppose sitename.com/folder?toy=231 is your Goal page. In this example ., ? are regex so we want to make them a plain text. We can do this by using backslash as
sitename\.com/folder\?toy=231
Where we can use Backslash ?
We can use Backslash (\) in Filters. For example in search and replace filter we can use this as Search string and can replace this as Replace string.
To exclude the I.P. addresses
We can use the Backslash to exclude the I.P. addresses of company. Suppose you want to exclude all IP addresses of your company. For example you have IP addresses from 122.163.202.83 to 122.163.202.93 the Regex for this will be
^122\.163\.202\.(8[3-9]|9[0-3])$
In this example some other regex are also used, but you can get the regex for IP addresses by using Google regex tool. In my next posts i will discuss about the other Regex, so please keep visiting my blog.
No comments:
Post a Comment