<commit_before>/*
    kircentity.cpp - IRC Client

    Copyright (c) 2004      by <NAME> <<EMAIL>>

    Kopete    (c) 2004      by the Kopete developers <<EMAIL>>

    *************************************************************************
    *                                                                       *
    * This program is free software; you can redistribute it and/or modify  *
    * it under the terms of the GNU General Public License as published by  *
    * the Free Software Foundation; either version 2 of the License, or     *
    * (at your option) any later version.                                   *
    *                                                                       *
    *************************************************************************
*/


#include <kdebug.h>

#include "kircentity.h"

const QRegExp KIRCEntity::sm_userRegExp(QString::fromLatin1("^([^\\s,:!@]+)(?:(?:!([^\\s,:!@]+))?(?:@([^\\s,:!@]+)))?$"));
const QRegExp KIRCEntity::sm_channelRegExp( QString::fromLatin1("^[#!+&][^\\s,:]+$") );

QString KIRCEntity::userInfo(const QString &s, int num)
{
	QRegExp userRegExp(sm_userRegExp);
	userRegExp.search(s);
	return userRegExp.cap(num);
}
#if KDE_IS_VERSION( 3, 2, 90 )
KResolverResults KIRCEntity::resolve(bool *success)
{
	resolveAsync();

	KResolver *resolver = getResolver();<commit_msg>Not allowing : in hostmasks breaks for ipv6 hosts<commit_after>/*
    kircentity.cpp - IRC Client

    Copyright (c) 2004      by <NAME> <<EMAIL>>

    Kopete    (c) 2004      by the Kopete developers <<EMAIL>>

    *************************************************************************
    *                                                                       *
    * This program is free software; you can redistribute it and/or modify  *
    * it under the terms of the GNU General Public License as published by  *
    * the Free Software Foundation; either version 2 of the License, or     *
    * (at your option) any later version.                                   *
    *                                                                       *
    *************************************************************************
*/


#include <kdebug.h>

#include "kircentity.h"

const QRegExp KIRCEntity::sm_userRegExp(QString::fromLatin1("^([^\\s,:!@]+)(?:(?:!([^\\s,:!@]+))?(?:@([^\\s,!@]+)))?$"));
const QRegExp KIRCEntity::sm_channelRegExp( QString::fromLatin1("^[#!+&][^\\s,:]+$") );

QString KIRCEntity::userInfo(const QString &s, int num)
{
	QRegExp userRegExp(sm_userRegExp);
	userRegExp.search(s);
	return userRegExp.cap(num);
}
#if KDE_IS_VERSION( 3, 2, 90 )
KResolverResults KIRCEntity::resolve(bool *success)
{
	resolveAsync();

	KResolver *resolver = getResolver();
{'fraction_non_alphanumeric': 0.2382170259408111, 'fraction_numerical': 0.0113262696382901, 'mean_word_length': 2.5329032258064514, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6327831', 'n_tokens_mistral': 834, 'n_tokens_neox': 771, 'n_words': 192}