Wildcard Characters
Permissions are typically mapped to individual users and groups of users. However it is not always possible to maintain the user list. It is for this reasons that users can be
referenced using wildcard characters. Like a wildcard character of * would imply all users registered in the database.
The supported wildcard characters are ‘’, ‘_’ and ‘.’ . The ‘’ character substitutes itself with any text at its position. The character is substituted with exactly one character at its position. The . character is substituted with at max one character at its position. The character * is used freely while the characters and . have to be enclosed within [ ] as in the case of [_] and [.]
It is important to note that wildcard characters only work on usernames and no on group names. The list of supported wildcard characters and its uses are mentioned in the below table:
Character / Pattern | Use |
---|---|
* | Refers to all users in the database |
admin-* | -All usernames that start with ‘admin-‘ -eg: admin-user1, admin-user2 |
admin-[_] | -All usernames that start with 'admin-' and are followed by exactly one character -eg: admin-1, admin-2 -admin-20 does not qualify as it has 2 characters following ‘admin-1’ |
admin-[_2] | -All usernames that start with 'admin-' and are followed by exactly twocharacters -eg: admin-10, admin-11 -admin-1 and admin-100 do not qualify as they have 1 and 3 characters respectively -The number 2 specified allows looping of the character to have the specified number of characters present within the [ ] |
admin-[.] | -All usernames that start with 'admin-' and are followed by at max one character -eg: admin-, admin-1, admin-2 -admin- qualifies as it has 0 characters, which is allowed as the . applies to at max one characters, so one or none are both satisfactory conditions. -admin-10 does not qualify as it has two characters |
admin-[.2] | -All usernames that start with 'admin-' and are followed by at max two characters -eg: admin-, admin-1, admin-10 -admin-100 does not qualify as it has three characters |
*-user[.3] | -All usernames that have the term ‘-user’ present and preceded by anything and followed by at max 3 characters. -eg: admin-user, admin-user01, -user01, portal-user100 |
user[_][_] | Is same as user[_2] |
user[_][.] | -All usernames that start with the term ‘user’ and are followed with at minimum one character and at max two characters -eg: user1, user10 -user and user100 do not qualify as they have 0 and 3 characters respectively |
user[_]* | -All usernames that start with the term 'user' and are followed by at minimum one character -eg: user1, user10, user100 -user does not qualify as it has 0 characters |
[_3] | All usernames that are exactly 3 characters in length |
[.3] | All usernames that are at max 3 characters in length |
[_2]* | All usernames that are at minimum two characters in length |
Updated over 5 years ago