How can I get an exact match for search-members? - mailchimp-api-v3.0

I am noticing that emails with '+' in them are not being searched as an exact match in search-members. For example {'query': 'email:bob+subscription_to_list_one#example.com'} will return bob+subscription_to_other_list#example.com in the full_search element and 0 entries in the 'exact_matches' element.
Does anyone know how exact-matches are found?
Does anyone know how to tell mailchimp to not treat the '+' character as special?

Encoding the plus sign '+', will fix the issue

It turns out that removing "email:" from the query populates the exact_matches element and returns nothing extra. Strange, but true.

Related

Using IN operator at tablix filters issue

I'm trying to add a filter with IN operator to my tablix. Problem is , my criteria values are already comma separated like A,B and C,D. Writing them like " 'A,B','C,D' doesn't seem to work.
I couldn't manage to get the filter working and all other questions/examples are for single word criteria. Any help?
I managed to fix this issue on my own by using a =split("2B,2C",",") function and changing the split notation (the last ,) to something other than a comma. Works very fine.
I hope this would help and save time for other people in future.

XPath & Replace Exact Match

can anyone help me with this?
I'm trying to change fields that have a "0" to Nothing.
I have this:
[str_replace("0",",{price[1]/sale[1]})]
but I think this will replace all fields that "contain" a 0 so for example if it had 301 then it would become 31. What I want is to only replace fields that only contain a single 0 to nothing.
How can I do this? (the code needs to be on a single line as it's run on a form field)
A simple way to do this may be as follows (not tested!):
[{string(price[1][number(sale[1]) != 0]/sale[1])}]
This expression includes an additional condition to only find the number if it is not 0 in the first place. If found it returns the number, otherwise it will return an empty string since the function string of an empty node set should yield exactly this.

Perfect way to write a gsub for a regex match?

I am trying to write a gsub for a regex match, but I imagine there's a more perfect way to do this .
My equation :
ref.gsub(ref.match(/settings(.*)/)[1], '')
So that I can take this settings/animals, and return just settings.
But what if settings is null? Than my [1] fails as expected.
So how can one write the above statement assuming that sometimes settings won't match ?
So that basically, if it finds the word, settings, than get rid of anything after it. But if it doesn't, no worries.
Thanks!
Why not do the simplest possible thing that could work?
ref.gsub(/(settings)(.*)/, '\1')

Count characters after given symbol in oracle varchar column value

How would I go about counting the characters after a certain character. I'm new to Oracle, and I've learned quite a bit however I'm stumped at this point. I found a couple functions that will get you a substring and I found a function that will give you the length of a string. I am examining an email address, myemail#thedomain.com. I want to check the length after the '.' in the email.
SELECT email
FROM user_table
WHERE length(substr(email, /*what values*/, /*to put here*/))
I don't know if it's actually possible to find the location of the final '.' in the email string?
I'm not sure I would use substr. You can try something like this :
select length('abcd#efgh.123.4567') - instr('abcd#efgh.123.4567', '.', -1) from dual
Using instr(..,..,-1) searches backwards from the last character to find the position.
Since you're doing checks, I suggest you validate the format with regular expressions using REGEXP_INSTR. For instance, an email validation I found on this site is REGEXP_INSTR(email, '\w+#\w+(\.\w+)+') > 0
I didn't check it myself, but it looks quite ok.
Cheers.

what does the empty regex match in ruby?

following a RoR security tutorial (here), i wrote something along the lines of
##private_re = //
def secure?
action_name =~ ##private_re
end
the idea is that in the base case, this shouldn't match anything, and return nil. problem is that it doesn't. i've worked around for the time being by using a nonsensical string, but i'd like to know the answer.
The empty regular expression successfully matches every string.
Examples of regular expressions that will always fail to match:
/(?=a)b/
/\Zx\A/
/[^\s\S]/
It is meant to not change the behavior of the controller in any way, as // will match every string.
The idea is that ##private is meant to be set in the controller to match things you DO want to be private. Thus, that code is meant to do nothing, but when combined with
##private = /.../ in the controller, gives you a nice privacy mechanism.

Resources