IRC masks Description of the standard IRC masks
Simple masks

An IRC mask is a string in a special format that identifies a user on IRC.
The standard basic format is:
<nick>!<username>@<host>
The <nick> part contains the nickname with that the user is widely known across the network.
The nickname format is generally restricted by the IRC network rules: usually it has a maximum length (9 on actual IrcNet servers for example), and can contain only a defined set of characters. Just as example, the character '!' obviously can't be included in a nickname.
The <username> part is the machine username of the remote user: this is usually retrieved by the IRC server at connect time by contacting the Ident service on the user's machine. Some IRC servers allow specifying this username inside the login messages and do not connect to the Ident service at all.
The <username> often has a special prefix character added by the IRC server:
this is rather server specific protocol, but the prefixes are somewhat standardized and the common meanings of them are:

    noprefix: I line with Ident

    ^: I line with OTHER type Ident

    ~: I line, no Ident

    +: i line with Ident

    =: i line with OTHER type Ident

    -: i line, no Ident

So finally you can find <username> strings like ~pragma or ^pragma, where pragma is the system username of the irc-user and ~ and ^ are prefixes.
The <host> part is the hostname of the remote user.
In most cases it is the human-readable format of the host name, but sometimes it happens to be an IP-address (when the host has no reverse DNS entry).
The IP address can be either in IPv4 format or in IPv6 format.
Some (weird from my point of view) servers hide certain parts of the IP address to prevent attacks to the user's machine.
Here are some examples of full irc-masks:
Pragma!^pragma@staff.kvirc.net
[jazz]!~jazz@jazz.myhome.com
luke!=skywalker@212.213.41.12
HAN!^solo@ff0f:a0a0:1011::ea80:1
Darth!vader@210.11.12.XXX
The irc-masks are case insensitive.

Wildcard masks

In some contexts the irc-masks can contain * and ? wildcards.
The wild masks are used to match a user within a set of them.
* matches any sequence (eventually empty) of characters and ? matches a single character.
Wildcards are allowed only in the <nick>, <user> and <host> part: so the wildest mask possible is:
*!*@*
that designates any nickname, any username on any host.
Here are some examples of wild masks:
Pragma!*pragma@212.101.102.*: matches any user with nickname Pragma, username that ends with pragma and coming from any machine on the 212.101.102 network.
*!solo@*.starwars.org: matches any nick with username solo (no prefix!) coming from any machine in the starwars.org domain.
Pragma!*@*: matches any user with nickname Pragma.

Index, Miscellaneous