Regular expressions are special characters that match or capture portions of a field, as well as the rules that govern all characters. Most of the filters included in Google Analytics use these expressions to match the data and perform an action when a match is achieved.
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Google Analytics - Regular Expression
1. ì
Google
Analytics
Regular
Expression
If
so,
it’s
5me
for
you
to
learn
about
Regular
Expressions
and
how
Google
Analy5cs
uses
them.
By
@daydev
–
Banyapon
Poolsawasd
2. ì
Google
Analytics
Regular
Expression
In
Google
Analy5cs,
you
can
use
Regular
Expressions
to
create
filters.
Many
filters
require
Regular
Expressions.
If
you
don’t
know
what
filters
are,
you
can
start
learning
about
them
here.
create
one
goal
that
matches
mul5ple
goal
pages.
Perhaps
your
“thank
you”
page
has
many
names,
but
to
you,
all
leads
are
the
same
goal.
So
you
can
use
Regular
Expressions
to
“roll
them
up.”
fine-‐tune
your
funnel
steps
so
that
you
can
get
exactly
what
you
need.
Remember,
Regular
Expressions
can
be
specific.
By
@daydev
–
Banyapon
Poolsawasd
3. ì
Google
Analytics
Regular
Expression
Start
a
Regular
Expressions
A
Backslash
“”
1st
A
backslash
“escapes”
a
character
If
Goal
URL
is
/folder?pid=123
How
to
The
ques5on
mark
already
has
another
use
in
Regular
Expression
rule.
We
can
do
it
like
this:
/folder?
pid=123
By
@daydev
–
Banyapon
Poolsawasd
4. ì
Google
Analytics
Regular
Expression
The
pipe
(tube)
“|”
is
the
simplest
of
2nd
Regular
Expressions
User
for
a
Goal
Set1
or
Set2.
(|
=
OR)
Example
Coke|Pepsi
is
mean
Google
Analy5cs
keyword
report
to
find
all
examples
of
searches
that
came
to
their
blog
using
either
the
keyword
Coke
or
the
keyword
Pepsi.
By
@daydev
–
Banyapon
Poolsawasd
5. ì
Google
Analytics
Regular
Expression
dot
“.”
Matches
any
single
character
3rd
(le^er,
number
or
symbol)
Example
Place
"."
everywhere
with
regular
expression
.ate
it
will
match
late,
date,
sate,
or
any
four-‐character
expression
Expression
Condi3on
input
google.com
it
will
match
google4com,
googlescom,
googledcom
if
you
need
to
find
google.com
only
you
will
used
expression
like
"google.com"
By
@daydev
–
Banyapon
Poolsawasd
6. ì
Google
Analytics
Regular
Expression
Dollar
sign
“$”
in
regular
expressions
A
Caret
“^”
in
regular
expressions
5th
$
Match
to
the
end
of
the
field
4th
Requires
that
your
data
be
at
the
beginning
of
its
field
Example
Example
suppose
you
have
some
pages
that
end
in
^site
matches
sitewhat
but
not
mysite
"htm"
and
others
in
"html."
Expression
Condi3on
Expression
Condi3on
If
you
need
to
find
Goal
URL
"subfolder2/"
site$
matches
ending
with
site
in
"/folder1/subfolder2/index.html"
but
not
sitescan
use
regular
expressions
"^/subfolder2"
it
will
match
"subfolder2/index.html"
can
used
"^/subfolder2/index.html"
By
@daydev
–
Banyapon
Poolsawasd
7. ì
Google
Analytics
Regular
Expression
The
Star
"*"
in
Regular
Expressions
The
Dot
Star
”.*”
There
are
two
6th
Matches
zero
or
more
of
the
7th
Regular
Expressions
that,
when
put
previous
item
together
Example
Example
The
default
previous
item
is
the
previous
use
"/XXX/.*index.php"
It
will
match
character.
everything
that
starts
with
XXX/
and
ends
“goo*gle”
It
will
matches
gooogle,
with
index.php
goooogle,
goooooooooogle
Expression
Condi3on
The
previous
item
is
defined
as
the
previous
character
aa*rgh.
That
will
match
aargh
and
aaargh
and
aaaaaaaaargh
By
@daydev
–
Banyapon
Poolsawasd
8. ì
Google
Analytics
Regular
Expression
A
Plus
Sign
"+"
matches
one
or
Grouping
more
of
the
former
items,
which,
as
Parentheses
“()”
in
Regular
8th
9th
usual,
we’ll
assume
is
the
previous
Expressions
work
the
same
way
character
that
they
do
in
mathema5cs
Just
like
a
star,
except
that
a
plus
sign
must
Use
parenthesis
to
create
an
match
at
least
one
previous
item
item,
instead
of
accep5ng
the
default
Example
“gooo+gle”
matches
goooogle,
but
never
google.
Example
Thank(s|you)
will
match
both
Thanks
and
Thankyou
"/folder(one|two)/thank"
It
will
Match
/foldertwo/thanks
/folderone/thank
By
@daydev
–
Banyapon
Poolsawasd
9. ì
Google
Analytics
Regular
Expression
Grouping
Example
10th
square
brackets
"[]"
and
dash
"-‐"
or
[a-‐z]
–
all
lower-‐case
le^ers
in
the
English
"[-‐]”
,use
brackets
to
create
a
list
of
alphabet
items
to
match
to,
like
[abc]
creates
[A-‐Z]
–
all
upper-‐case
le^ers
in
the
English
a
list
with
a,
b
and
c
in
it
Alphabet
[a-‐zA-‐Z0-‐9]
–
all
lower-‐case
and
upper-‐
Use
dashes
"-‐"
with
brackets
to
extend
your
case
le^ers,
and
digits.
list,
like
[A-‐Z]
creates
a
list
for
the
uppercase
English
alphabet
Note
they
are
not
separated
by
commas.
By
@daydev
–
Banyapon
Poolsawasd
10. ì
Google
Analytics
Regular
Expression
Not
in
a
Document
11th
Braces
“{}”
repeat
the
last
“piece”
of
informa5on
a
specific
number
of
5mes.
such
as
{x,y},
it
means,
repeat
the
last
“item”
Braces
are
not
covered
in
the
Google
at
least
x
5mes
and
no
more
than
y
5mes
Analy5cs
documenta5on,
but
they
are
supported
Example
IP
address
–
they
ouen
have
a
block
of
numbers.
So
let’s
say
that
their
IP
addresses
go
from
123.145.167.0
through
123.145.167.99
Used:
123.145.167.[0-‐9]{1,2}
By
@daydev
–
Banyapon
Poolsawasd
11. ì
Google
Analytics
Regular
Expression
Thank
You
for
A^en5on
By
@daydev
–
Banyapon
Poolsawasd