Need help with GA regex

I am trying to setup a regular expression for an “include
hostname only” filter for google analytics and I am not really sure how
to do this for an Australian domain.

Which one of these is correct?



.(star symbol)mydomain(backslash).com(backslash).au.(star symbol)

Normally I would just verify the filter but I cannot verify it
because google says the amount of traffic is too small for verification.

Hey could a mod please put this back in the javascript forum where it was originally.

It most definitely does not belong in general web dev.

Only a javascript expert would be able to answer this quetion since it is javascript regular expressions that are used for Google Analytic Filters.

Actually, one could argue that JS regex is based on Perl regex so this should be in Perl



will match eg.

i.e. any one character in front of “mydomain”


.(star symbol)mydomain(backslash).com(backslash).au.(star symbol)

will match eg.

Looks to me like neither are what you’re after, got a link to the Google Analytic Filters documentation page?

Here is a link to the official documentation

A couple of regex threads were created after mine in the javascript forums and are still there, I have no idea why Pullo moved my thread here, maybe it was due to my lack of code formatting (which I dont have access to yet because my account is too new)


to match

I would use

Which roughly translates to
begins with - the ^
maybe www. - the (www.)?

the backslash means “.” is the literal character and not the regex “anything” wildcard

thanks for the replies guys, I will give this a shot

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.