RegEx Google Analytics Goal with Parameters - regex

I am currently setting up tracking and goals for a client.
I am setting a Destination goal where the Regular express is set to something along the lines of:
.*/summits-thank-you/ however we have changed the URL to /summits/?newsletter=true
The question is how do I get /summits/?newsletter=true to work in Regular Express like /summits-thank-you/?
Cheers :)

Would .*/summits/\? do the trick? Or .*/summits/\?newsletter=true?

Related

RegExp_Extract everything before first dot in Google Data Studio

I'm trying to use Google Data Studio to build a dashboard of browser versions. The "Browser Version" field in Google Analytics has too much detail so I want to extract everything before the . in a version number. I've tried creating a new field with the following formula, but keep getting an error "Could not parse formula". I've tested this RegEx on regex101.com and it seems to work so maybe I'm not understanding something about Google Data Studio?
REGEXP_EXTRACT(Browser Version,'^(.+?)\.')
Try the below regular expression. I believe the issue is because (not set) is also a possible value for the Browser Version dimension, so your regex must cater for that condition as well.
REGEXP_EXTRACT(Browser Version,'^\\D*(\\d+)\\D*')

Remove alt attributes from HTML

I have a huge HTML file which I'm trying to format to be able to import the content into a different application. The one thing that remains is that I need to remove all alt attributes from the HTML entirely. They all have different values and there are around 5000 of them, so clearly a straight find & replace isn't an option. Perhaps there's a way to find and replace with regex in Visual Web developer?
The tools/skills I have available are: HTML, Javascript, ASP (Classic), a little bit of .NET, Visual Web Developer Express 2010, but the only similar things I can find are PHP-based and they don't explain fully enough for me to set up a solution and feed the HTML to it.
I've found things like this: Regular expression to replace several html attributes, which give suggestions of regex functions which do similar things, but I'm not even sure how to run a regex function on a straight HTML file (my browser is struggling with the size of the HTML file as it is, so I don't think javascript is going to cut it).
Can anyone suggest the best way to accomplish this?
Thanks folks...
Since you use Visual Studio, you can try the Regex search & replace option, though the implementation of regexes in Visual Studio is pretty different from other regex engines.
Here's a short article about it:
http://www.codinghorror.com/blog/2006/07/the-visual-studio-ide-and-regular-expressions.html
As it says in the article, the builtin regex engine isn't ideal. They mention a plugin with implements standard regexes though:
http://www.codeproject.com/Articles/9125/Standard-Regular-Expression-Searcher-Addin-For-VS

regex to separate HTML GET parameters

How can I use a regular expression to separate GET parameters in a URI and extract a certain one? Specifically, I'm trying to get just the v= part of a YouTube watch URI. I've come up with youtube.com\/watch\?(\w+=[\w-]+&?)*(v=[\w-]+)&?*(\w+=[\w-]+&?)*, but that looks awfully repetitive. Is there a better (shorter?) way to do this?
A simplified regex :
^(?:http://www.)?youtube.[^/]+?/watch?(.?)(v=([^&]+))(.)$
I know there are a lot of similar questions out there, but none has quite what I wanted. I'm looking for something capable of pulling out just the video ID—regardless of whether it's first in the parameter list, last, or buried in between others. Nothing I've seen has worked quite like that yet.
For reference, I'm using this web app for testing, and this set of test URIs:
http://www.youtube.com/watch?v=XXXXXXXXXXX
http://www.youtube.com/watch?v=XXXXXXXXXXX&feature=results_video&playnext=1&list=XXXXXXXXXXXXXXXXXX
http://www.youtube.com/watch?feature=player_embedded&v=XXXXXXXXXXX#!
http://www.youtube.com/watch?annotation_id=annotation_xxxxxx&feature=iv&src_vid=XXXXXXXXXXX&v=XXXXXXXXXX
Fellow Stack Exchangers, I propose the following regular expression to solve this:youtube.com\/watch\?(\S*)v=([\w-]+)

Twitter queries using regexp?

I have been seeing posts and questions about using regexp to search for tweets on twitter using the java twitter API. Now, I have been trying to do that for the last two hours reading all possible resources on that with no success. For example: I am simply trying to query twitter once, but receive the tweets for both "guerillacafe" or "guerilla cafe"
I have tried (guerillacafe|guerilla cafe), ('guerillacafe'|'guerilla cafe'), (guerillacafe OR guerilla cafe), (guerilla?cafe) and many more, but like I said , I cant get it to work.
Please help with a simple regexp that would do the trick.
The Java Twitter API does not allow for regexp searches. The OR keyword is supported (your third example works for me).

Is there an editor to autoindent / add spaces in existing code?

I have some JavaScript code which I want to make more readable. However, due to the amount of code I want to use a tool which does this automatically for me.
Are there such tools already available or do I have to manually perform some "find/replace-alls"?
The code which I want to convert is written on a single line without spaces.
Quick search found http://jsbeautifier.org/ which seems to do what you are looking for online.
Search terms: javascript beautifier