Pattern pattern = Pattern.compile("^(?:[:@]([^\\s]+) )?([^\\s]+)(?: ((?:[^:\\s][^\\s]* ?)*))?(?: ?:(.*))?$");
Matcher matcher = pattern.matcher(line.subSequence(0, line.length()));
if (matcher.matches()) {
	source =;
	//i.e 433/NOTICE
	cmd =;
	//i.e Nickname/#channel
	target =;
	//i.e I have 3093 clients and 1 servers
	param =;

I use this regex for an IRC bot I created. Above is an example in JAVA. It makes use of the following regex: ^(?::@ )?([^\s]+)(?: ((?:[^:\s][^\s]* ?)))?(?: ?:(.))?$

It will match 4 groups (source, command, target and the parameters).

Examples in other languages and better solutions are welcome.