I want to validate an email id entered by the use inside a textfield from C++ in Blackberry 10 App.
Can anyone suggest how it can be done ?
thanks in advance.
Use the Validator API added in 10.1: cascades_validator.html">https://developer.blackberry.com/cascades/reference/bb_cascades_validator.html
You would need to supply your own regex to match an email though. There are lots of examples that do that on the Internet. You can start with (and maybe just end with) the information on http://www.regular-expressions.info/email.html
Related
So I know that email validation is quite a difficult thing to do. I have already written a regex that checks for a valid email adress. The problem is writing the security rule, seeing as I am dealing with a map in cloud firestore. The map looks like this:
email{
work: ""
personal: ""
}
The problem is the fact that I cannot guarantee that a specific value will match the regex. Users should be able to have only a personal email, only a work email or both a personal and work email. All of the situations should result in validated email adresses in firestore.
I currently have the following code, but I can't figure out how to deal with maps like this:
match /organisations/{orgID}/people/{userID} {
allow create: if(request.resource.data.email.matches(^[A-Za-z0-9]{3,}[#]{1}[A-Za-z0-9]{3,}[.]{1}[A-Za-z0-9]{3,}$) == true);
}
Is this doable with just one security rule? If yes, how? If no, how do I manage this another way? I'd rather use security rules over writing a cloud function for this if possible.
I currently have something like this, but I get an error because firebase doesn't seem to recognize the | (OR) operator. Is there any alternative for doing this? I'm tring to test if the email is either valid or null.
match /organisations/{orgID}/people/{userID}{
allow create: if(
request.resource.data.email.work.matches(^[A-Za-z0-9.]{3,}[#]{1}[A-Za-z0-9.]{3,}[.]{1}[A-Za-z0-9.]{3,}$|"")
);
}
Thanks in advance for your help!
You have two distinct problems here. They are not directly related to each other. I will try to address them separately.
The problem is writing the security rule, seeing as I am dealing with a map in cloud firestore.
If you want to use the value of a nested field within map field, you can simply use dot notation to get to it:
request.resource.data.email.work
request.resource.data.email.personal
The problem is the fact that I cannot guarantee that a specific value will match the regex. Users should be able to have only a personal email, only a work email or both a personal and work email.
You will need to write logic to check each map field separately. You can't check all fields of the map at the same time.
I'm working with the Google Admin SDK Directory API, more specifically with Mobile Devices. I already used the tool provided by Google here and also created a program using the .Net client library to get all devices with success.
The problem is, I need now to get all the mobile devices filtered by a list of emails. I was able to filter using a single email address like:
https://www.googleapis.com/admin/directory/v1/customer/ZXXXXX/devices
/mobile?projection=BASIC&query=email:EMAIL_HERE&key={YOUR_API_KEY}
But I couldn't find a way to filter using multiple email values like:
query email: email1:#my-domain.com, email2#my-domain.com, email3#my-domain.com
The documentation provided here on the Search string format does not specify nor give examples for this case.
EDIT: The documentation on the Search String Format does say this:
To Search within a specific field: enter an operator followed by an
argument. For example, user:joesabia. You can use single words or
quoted lists of words as an argument when running an operator query.
So, I tried doing something like this in the query box:
email:"email1#my-domain,com""email2#my-domain,com"
There is no OR in the query format. You'll need to either use multiple API calls with one email query per call or just list all devices and filter by email locally.
You can combine multiple fields search in query string separated by space for example email=test#example.com name:Test. But in your case just give it a try doing this email:test#example.com email:test2#example.com.
This is slightly beyond my ken.
I have a newsletter signup confirmation URL formed like:
http://godoymedical.net/?wysija-page=1&controller=confirm&wysija-key=7b246d4fc4c91968b0529237169787df&action=subscribe&wysijap=subscriptions&wysiconf=YToyOntpOjA7czoxOiI0IjtpOjE7czoxOiIzIjt9
I need to track it with RegEx in Google Analytics. The important parts are clearly:
wysija-page=1
controller=confirm
action=subscribe
When that stuff appears in an URL, I need to record it as a signup. Yeah, way over my head. Anyone here done this before?
If you want to capture everything no matter what the string might be after = then you could use:
(wysija-page=\d+)(?:.*)(controller=\w+)(?:.*)(action=\w+)
example: http://regex101.com/r/tP1fG3
If you specifically only want page=1 controller=confirm, etc.
(wysija-page=1)(?:&.*)(controller=confirm)(?:.*)(action=subscribe)
example: http://regex101.com/r/hI3pO2
Does anyone know of a list of email addresses (which don’t need to be real) I can use for an email validation assembly for a unit test?
I’ve been looking for such a list and can’t seem to find one. I’m not looking for real addresses, just ones that fit, and the more things I can throw at the test the better. I’ve got 10 right now, but if there is a list, it would give me a more thorough test.
I believe you were looking for something like this:
List of Valid and Invalid Email Addresses
Check the tests of the Apache Commons EmailValidator class:
EmailTest,
EmailValidatorTest.
The EmailValidatorTest in the Hibernate Validator also contains some address.
I like to use the set in this page on email validating regexes because the addresses contain what they're testing inside the email address.
Here is a set of test emails that Dominic Sayers uses to test his isEmail validator:
http://code.iamcal.com/php/rfc822/tests/
For more on isEmail:
http://isemail.info/about
We are facing issues of javascript getting embedded into message body,
following is the code snippet of the javascript,
} {*\htmltag241 var
DanaShimData="var DSJsFuncs =
,null,,,,[{nm:\"Refresh\",lcnm:\"refresh\",flg:0xb},{nm:\
\"Install\",flg:0xf},{nm:\"writeln\",flg:0x3f},{nm:\
"GotoURL\
\",flg:0xe},{nm:\"AddRoot\",lcnm:\"addroot\",flg:0xb},{nm:\
\"LoadURL\",lcnm:\"loadurl\",flg:0xb},{nm:\"addRule\
",flg:0xf},
{nm:\"postURL\",lcnm:\"posturl\",flg:0x12},{nm:\
"replace\ \",flg:0x12f},],[{
Could anyone please let us know if you have observed such occurances /
findings.
Any helps appreciated.
Thanks,
Sudipta Ghosh
Try to use HTMLCodeFormat() or HTMLEditFormat().
See docs.
There is a project called 'AntiSammy' (http://www.antisamy.net/) which uses files to combat XSS attacks that are provided by big sites like Slashdot and eBay. You may want to look at extracting the AntiSammy code to help you.
Here is a post by Peter Freitag on using AntiSammy without ColdBox.
http://www.petefreitag.com/item/760.cfm
Here are the docs for the ColdBox Framework:
http://wiki.coldbox.org/wiki/Plugins:AntiSamy.cfm
Also make sure you use cfqueryparams, captchas or some sort of session authentication form posts.