Jordan Magnuson
Jordan Magnuson

Reputation: 884

Google analytics regular expression

I'm trying to set up a Google Analytics goal url regular expression to match:

Any number of any characters followed by "first-login?" followed by any number of any characters.

Examples:

Seems simple, but I'm a total noob at regex. Thanks for the help!

Upvotes: 0

Views: 273

Answers (1)

nhahtdh
nhahtdh

Reputation: 56829

You can use a simple indexOf to search for the first-login? substring in the URL.

If that is not possible, the Perl compatible regex below will match a URL that contains first-login? as substring. You may need to add separator character or string escape depending on the language you are using.

^.*first-login\?.*$

(Note: answer edited to match the question)

Upvotes: 3

Related Questions