I just started working with Django 1.4 recently. I remember when I worked with 1.3 that there was a list of characters which were allowed as password characters. It included the usual alphanumeric as well as a few special characters, such as $, %, _, and #.
Does anyone know where in the documentation I can find the list of permitted password characters?
Thanks.
You probably mean the limitation of allowed chars for username. There is no limitation on inputted password. You can use one character as long as you can input it in password input. There is a set of chars for making a random password, but its not the limitation.
Related
Passwords are after ":" And password policy is that the password must be 7 to 32 characters long and The password must contain a mix of letters, numbers, and/or special characters also passwords containing only letters or only numbers are not accepted
Means if we have
username:Password42
Username52#:sssdt3
user:Pass!626795
use:uss
it removes all and only leaves
username:Password42
user:Pass!626795
i tried using
^:*(?!(?=.*\d)(?=.*[a-z])(?=.*[A-Z])|(?=.*\d)(?=.*[a-z])(?=.*[!##$%^&*()_+])|(?=.*\d)(?=.*[A-Z])(?=.*[!##$%^&*()_+])|(?=.*[a-z])(?=.*[A-Z])(?=.*[!##$%^&*()_+])|(?=.*[a-z])(?=.*[A-Z])(?=.*[!##$%^&*()_+])).*$\R*
but it didnt work good, Idk what's wrong in it, Maybe please anyone fix it for me for my policy?
You can use this regular expression to remove lines with wrong passwords: ^.+?:(.{1,6}|.{33,}|[[:alpha:]]+|\d+)$:
too short,
too long,
consisting of letters only,
consisting of digits only.
I require a regex for password field
I tried before posting but couldn't get through.
which validates the field for:
at least one special char
at least one alphabetic character
at least one numeric char?
Here is an article on how to write regex password validation strings:
http://nilangshah.wordpress.com/2007/06/26/password-validation-via-regular-expression/
In your case, you would look for something like this:
^.*(?=.{8,})(?=.*\d)(?=.*[A-Za-z])(?=.*[.,!-##$%^&+=_]).*$
This would require your password to be at least eight characters, contain a letter, a number, and a special character (one of these: .,!-##$%^&+=_)
If you are really struggling with regex, I would suggest you try something like this (free) tool for helping you build regex expressions:
http://www.radsoftware.com.au/regexdesigner/
Here is a regex that will require at least one alpha, one numeric, and one special character.
^.*(?=.*[a-z])(?=.*[A-Z])(?=.*[\W])(?=.*[\d]).*$
More info here.
My application creates a SharePoint site and an Active Directory group from user input. Special characters that are mentioned in http://www.webmonkey.com/reference/Special_Characters becomes a big problem in my application. Application creates group names differently and application can't access them from name property. I want the user input to be validated from a regular expression for these characters. I googled in and found some good regex sampler and testers but they won't solve my problem. So can anybody suggest a regex for disallowing special characters which is a problem for Active Directory object names?
P.S. Application users may enter Turkish inputs, so regex should also allow Turkish characters like 'ç', 'ş', 'ö'
You should start with something like this:
^(\p{L}|\p{N}|\p{P})+$
This will match:
\p{L}: any kind of letter from any language
\p{N}: any kind of numeric character in any script
\p{P}: any kind of punctuation character.
When you query your AD, you must to escape some special characters, described here: Creating a Query Filter
If any of the following special characters must appear in the query filter as literals, they must be replaced by the listed escape sequence.
ASCII Escape sequence
character substitute
* "\2a"
( "\28"
) "\29"
\ "\5c"
NUL "\00"
In addition, arbitrary binary data may be represented using the escape sequence syntax by encoding each byte of binary data with the backslash followed by two hexadecimal digits. For example, the four-byte value 0x00000004 is encoded as "\00\00\00\04" in a filter string.
I'm looking to match Twitter syntax with a regex.
How can I match anything that is "#______" that is, begins with an # symbol, and is followed by no spaces, just letters and numbers until the end of the word? (To tweeters, I want to match someone's name in a reply)
Go for
/#(\w+)/
to get the matching name extracted as well.
#\w+
That simple?
It should be noted that Twitter no longer allows usernames longer than 15 characters, so you can also match with:
#\w{1,15}
There are still apparently a few people with usernames longer than 15 characters, but testing on 15 would be better if you want to exclude likely false positives.
There are apparently no rules regarding whether underscores can be used the the beginning or end of usernames, multiple underscores, etc., and there are accounts with single-letter names, as well as someone with the username "_".
#[\d\w]+
\d for a digit character
\w for a word character
[] to denote a character class
+ to represent more than one instances of the character class
Note that these specifiers for word and digit characters are language dependent. Check the language specification to be sure.
There is a very extensive API for how to get valid twitter names, mentions, etc. The Java version of the API provided by Twitter can be found on github twitter-text-java. You may want to take a look at it to see if this is something you can use.
I have used it to validate Twitter names and it works very well.
What are the reasons behind URLEncodedFormat() escaping valid URL characters?
valid characters:
- _ . ! ~ * " ( )
The CF8 Doc said, "[URLEncodedFormat() escapes] non-alphanumeric characters with equivalent hexadecimal escape sequences." However, why escape valid URL characters?
They are valid, but it seems pretty normal to me that if you ask a programming language to url encode a string that it converts all non alpha numeric chars to the hex equivalent.
ASP's Server.URLEncode() does the same and php urlencode() does too except for - and _. Also, in javascript, the encodeURIComponent() function will encode all non alpha numeric chars to hex equivalents.
This is a good idea anyway to encode all non alpha numeric characters when using user input for forming server requests to prevent anything unexpected from happening.
Is the encoding of valid url characters causing an error or a problem?
One issue might be that by not doing so, if you embed a link with non-encoded characters in an email, the email software may decide to break the link into two lines.
If you use a fully encoded url though, the chances of this are greatly reduced. Just one way of seeing it though.
I could see at least in the case of " that it would be nice to have it encoded when using the URL as a link in an anchor tag.