Solved

reg ex for site filter for google analytics

Posted on 2011-09-29
8
275 Views
Last Modified: 2012-05-12
Hello we need to do a filter that is like this

www.admin.com
www.admin.com/?vb=something       <<< only on in this profile to be shown
www.admin.com/other

so the regex need to block all that dose not have ?vb=something . please let me know if this is not totally clear but the short is we need to show nothing but the one path with out useing the javascript to set the domain path as that is not an option here.  Just need to filter data on the reporting end of google.  

Thank you
Cheers -Jeremy
0
Comment
Question by:jeremyBass26
8 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 36815886
You might try:

\?vb=.*$

Open in new window

0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 36816009
so a quick test here http://regexhero.net/tester/ of  

test.domain.edu/?vb=test

with

\?vb=.*$

dosn't provide a match thou it doesn't match just test.domain.edu/ as expected.

tk -j

0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 36816049
oh and I beleive for google you need it to be a not match ?vb= in string as when you put the filter in you are asking them to filter so we need to filter all but ?vb=
0
 
LVL 4

Author Comment

by:jeremyBass26
ID: 36816081
I have been playing with

^.*?(?!\?vb\=).*?$

and trying to get that to work
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 36816803
Try:

\?(?!vb=)

Open in new window

0
 
LVL 10

Expert Comment

by:mark_harris231
ID: 36893648
I believe you want this:

Match: ^([^\?]*)$    (match all characters unless a question mark is found)
Replace:                (i.e., replace the matched line with a blank line

If you want to eliminate the blank lines and condense the report, replace $ with \n or \n\r  (not sure if your report contains carriage returns)
0
 
LVL 35

Accepted Solution

by:
Terry Woods earned 500 total points
ID: 36900594
I think this is what you want:

^(.(?!\?vb=))*$
0
 
LVL 4

Author Closing Comment

by:jeremyBass26
ID: 36903266
Perfect.. Thanks everyone else but this was it.  

Glad to see mine :
^.*?(?!\?vb\=).*?$

was not far off .. TerryAtOpus's

^(.(?!\?vb=))*$

worked perfectly at that http://regexhero.net/tester/ site.  Thanks for the help.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now