Segment Builder - Any way to 'paste' in multiple URLs (due to varying name conventions/etc)? - adobe-analytics

I'm trying to build a couple of segments based on entry url. Unfortunately, the site has inconsistent name conventions/url structures so using 'Starts With' or some of the other search operators isn't much help. Is there a way to 'paste' (and use a separator) a list of various entry urls or am I going to have to do this one by one?
Current (inefficient)
::Entry URL = URL 1 OR Entry URL = URL 2, etc..
Hoping for (more efficient)
:Entry URL matches any of these: URL1, URL2, etc (pasted in single field?)
Thanks for any help!

Use match type "matches regex" and list your values with "|" in one field.
URL1|URL2

Related

GSheets - How to query a partial string

I am currently using this formula to get all the data from everyone whose first name is "Peter", but my problem is that if someone is called "Simon Peter" this data is gonna show up on the formula output.
=QUERY('Data'!1:1000,"select * where B contains 'Peter'")
I know that for the other formulas if I add an * to the String this issue is resolved. But in this situation for the QUERY formula the same logic do not applies.
Do someone knows the correct syntax or a workaround?
How about classic SQL syntax
=QUERY('Data'!1:1000,"select * where B like 'Peter %'")
The LIKE keyword allows use of wildcard % to represent characters relative to the known parts of the searched string.
See the query reference: developers.google.com/chart/interactive/docs/querylanguage You could split firstname and lastname into separate columns, then only search for firstnames exactly equal to 'Peter'. Though you may want to also check if lowercase/uppercase where lower(B) contains 'peter' or whitespaces are present in unexpected places (e.g., trim()). You could also search only for values that start with Peter by using starts with instead of contains, or a regular expression using matches. – Brian D
It seems that for my case using 'starts with' is a perfect fit. Thank you!

Teradata:Get a specific part of a large variable text field

My first Post: (be kind )
PROBLEM: I need to extract the View Name from a Text field that contains a full SQL Statements so I can link the field a different data source. There are two text strings that always exist on both sides of the target view. I was hoping to use these as identifying "anchors" along with a substring to bring in the View Name text from between them.
EXAMPLE:
from v_mktg_dm.**VIEWNAME** as lead_sql
(UPPER CASE/BOLD is what I want to extract)
I tried using
SELECT
SUBSTR(SQL_FIELD,INSTR(SQL_FIELD,'FROM V_MKTG_TRM_DM.',19),20) AS PARSED_FIELD
FROM DATABASE.SQL_STORAGE_DATA
But am not getting good results -
Any help is appreciated
You can apply a Regular Expression:
RegExp_Substr_gpl(SQL_FIELD, '(v_mktg_dm\.)(.*?)( AS lead_sql)',1,1,'i',2)
This looks for the string between 'v_mktg_dm.' and ' AS lead_sql'.
RegExp_Substr_gpl is an undocumented variation of RegExp_Substr which simplifies the syntax for ignoring parts of the match

TFS code search find <Button>

I want to find all usages of my react component in code.
I tried <Button> but Special chars <> are not supported.
Tried "Button" and i get "Button" and button with lowercase as results as well.
So exact match is also not supported.
Is there is a way to find a string exactly without any additional results?
Unfortunately, search symbols (<> and "" in your scenario) is not supported in code search.
In tfs the symbol "" is used for finding an exact match to a set of words by enclosing your search terms in double-quotes. For example, "Client not found".
Is there is a way to find a string exactly without any additional
results?
Yes, but it seems a little complex, just reference my answer in another thread:Is there a way to make TFS code search recognize the "#" symbol?
Checked for some characters in code search. You can't use the symbol
characters except * and ? as part of your search query, which
including below characters: . , : ; / \ ` ' " # = ! # $ & + ^ | ~ < >
( ) { } [ ]. The search will simply ignore these symbols.
But you can use wildcard characters * and ? to broaden your search.
You can use wildcard characters anywhere in your search string except
as a prefix in a simple search string or a query that uses a code type
filter. For example, you cannot use a search query such as
*RequestHandler or class:?RequestHandler. However, you can use prefix wildcards with the other search filter functions; for
example, the
search query strings file:*RequestHandler.cs and repo:?Handlers are
valid.
Please see Broaden your search with wildcards for details.
If you want to search the strings including these symbol exactly(such
as '#' here), you can code search with other strings (eg,
testexample.com here) to narrow down the scope first, then copy the
specific code to text editor which support the symbols (eg,
Notepad++), then search stings with the symbol characters.
Besides, if you are using Git, another workaround is using the code
search tool Hound: a lightning fast code search tool, it supports
the symbol characters. Reference this thread to use it:
How can I publish source code (Visual Studio) on a intranet?
Also, there is a User Voice here to suggest the feature, you can go and vote it up to achieve that in future.

How do I grab all the content from within [url] including square brackets and match group 1 and 2

I have this regular expression
/\[url=(?:")?(.*?)(?:")?\](.*?)\[\/url\]/mi
and these blocks of text
[url=/someurl?page=5#3467]First[/url][postquote=true]
[url=/another_url/who-is?page=4#3396] Second[/url]
Some text[url=/another_url/who-is?page=3][i]3[/i] Third [/url]
and the regex works great at extracting the urls and text between the urls
Match 1
1. /someurl?page=5#3467
2. First
Match 2
1. /another_url/who-is?page=4#3396
2. Second
Match 3
1. /another_url/who-is?page=3
2. [i]3[/i] Third
The problem happens when I use the same regex from above to try to extract the url from this text
This is some text [url=https://www.somesite.com/location/?opt[]=apples]Link Name[/url]
Match 1
1. https://www.somesite.com/location/?opt[
2. =apples]Link Name
Notice the =apples] in the second match. What I need is the matched first match to include that in the url like
https://www.somesite.com/location/?opt[]=apples
Link Name
I have tried many modifications to this regex and no go so far, any help would be appreciated.
Ruby regex has the duplicate named capture feature. With this feature, you can handle the two cases easily (the one with &quote; and the other). You don't have to use a recursive pattern since I doubt that [] can be nested in the query part of a url:
/\[url=(?:&quote;(?<url>[^&]*(?:&(?!quote;)[^&]*)*)&quote;|(?<url>[^\s\]\[]*(?:\[\][^\s\]\[]*)*))\](?<text>.*?)\[\/url\]/mi
the url is in the named group url and the content between tags is in the named group text.
in a more readable format:
/
\[url=
(?:
&quote; (?<url> [^&]* (?:&(?!quote;)[^&]*)* ) &quote;
|
(?<url> [^\s\]\[]* (?:\[\][^\s\]\[]*)* )
)
\]
(?<text>.*?)\[\/url\]
/mix

Double slashes in urls in Outlook

The url of our search page is build like this:
http://www.example.com/results/name/John/city/Miami/gender/Male
This would display every male named John in Miami.
When one of the filters is left empty, the url would be something like this:
http://www.example.com/results/name/John/city//gender/Male
So there are two slashes in the url.
Outlook doesn't seem to like this. When you click on the second url, it removes one of the two slashes. This leaves the url like this:
http://www.example.com/results/name/John/city/gender/Male
Persons names John in the city 'gender'..
What would be the best way to fix this problem?
This is a bug in Microsoft Office.
URLs with two consecutive slashes are allowed by RFC 2396, but they're not commonly used. As the RFC says (extract from Appendix A):
abs_path = "/" path_segments
path_segments = segment *( "/" segment )
segment = *pchar *( ";" param )
Note that segment is defined as containing ZERO OR MORE characters. (You might argue that this is a spec bug, and it shouldn't be allowed... but it is)
As you've discovered, Microsoft Office will "fix" URLs containing double slashes. This is apparently a deliberate feature for "cleanliness and consistency". There is no way to override or disable it. Source.
So, as other people have suggested, you're probably going to have to change the way the server formats URLs.
Try to replace (one of) the slashes with ASCII code 2F (decimal 47).
"Regkey" should help: You need to implement this key
Path: "HKEY_CURRENT_USER\Software\Microsoft\Office\Common"
Name: "AllowConsecutiveSlashesInUrlPathComponent"
Type: "REG_DWORD"
Value: "1"
For implementation & more detail see here.
The standard is to collapse the two slashes into one, so there is no way to prevent this from happening. It might be a good idea to put something between those slashes to indicate to your search page that that field is blank.
Alternatively, you could change the search page to use a query string such as this:
http://www.example.com/results?name=John&city=&gender=Male
You can use - instead of blank segment. For example:
http://www.example.com/results/name/John/city/-/gender/Male
I agree with Peter, just replace the second "/" with "%2F" or "%2f" is enough.
If you must use slashes, consider fixing this on the server side. Create a list of keywords (city|results|...) and, if a slash is followed by one of the keywords, treat it as an empty entry. (edited) Double slashes should not be treated as one, but as you found out, some applications "fix" this.
An alternative and standard way of fixing this is using a placeholder, normally a dot, because it has no special meaning:
http://example.com/results/name/./city/amsterdam

Resources