<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/17170" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2009-09-09T14:16:57-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/17170</id>

		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-09-09T14:16:57-04:00</updated>

		<published>2009-09-09T14:16:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90197#p90197</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90197#p90197"/>
		<title type="html"><![CDATA[[SOLVED] IRC nick regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90197#p90197"><![CDATA[
Heh, OK. Many thanks. Coffee is a necessary tool for coding.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Wed Sep 09, 2009 2:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-09-09T14:11:14-04:00</updated>

		<published>2009-09-09T14:11:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90196#p90196</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90196#p90196"/>
		<title type="html"><![CDATA[IRC nick regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90196#p90196"><![CDATA[
Darn, you're right!<br>Must've overlooked that \d in there.. (and way too little coffee today)<br><br>As such, your regular expression should be in line with rfc2812 (although not rfc1459). Being rfc2812 the most common standard these days, I'd say it'll work well with most networks (might be worth adding note as to being rfc2812-compliant, if you're worried users will have issues on non-standard servers)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Sep 09, 2009 2:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-09-09T14:03:08-04:00</updated>

		<published>2009-09-09T14:03:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90195#p90195</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90195#p90195"/>
		<title type="html"><![CDATA[IRC nick regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90195#p90195"><![CDATA[
I don't really see that those extra characters are allowed in the regexp pattern<br><br>; == \x3B<br>: == \x3A<br>? == \x3F<br>@ == \x40<br><br>All of which are outside the range \x41-\x7D<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Wed Sep 09, 2009 2:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-09-09T13:42:08-04:00</updated>

		<published>2009-09-09T13:42:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90194#p90194</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90194#p90194"/>
		<title type="html"><![CDATA[IRC nick regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90194#p90194"><![CDATA[
I'd say that, apart from the nick length, most irc networks atleast adhere to rfc2812, some possibly rfc1459 as well.<br><blockquote class="uncited"><div>&lt;nick&gt;       ::= &lt;letter&gt; { &lt;letter&gt; | &lt;number&gt; | &lt;special&gt; }<br>...<br>&lt;letter&gt;     ::= 'a' ... 'z' | 'A' ... 'Z'<br>&lt;number&gt;     ::= '0' ... '9'<br>&lt;special&gt;    ::= '-' | '[' | ']' | '\' | '`' | '^' | '{' | '}'</div></blockquote><blockquote class="uncited"><div>nickname   =  ( letter / special ) *8( letter / digit / special / "-" )<br>...<br>letter     =  %x41-5A / %x61-7A       ; A-Z / a-z<br>digit      =  %x30-39                 ; 0-9<br>...<br>special    =  %x5B-60 / %x7B-7D<br>                   ; "[", "]", "", "`", "_", "^", "{", "|", "}"</div></blockquote>As such, your regular expression permits more characters than either rfcs. Mainly, you allow characters such as "; : ? @" in your expression, which are not allowed within a nickname.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Sep 09, 2009 1:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-09-09T13:04:39-04:00</updated>

		<published>2009-09-09T13:04:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90193#p90193</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90193#p90193"/>
		<title type="html"><![CDATA[IRC nick regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90193#p90193"><![CDATA[
Fair point. Sorry, I seem to have elicited that response due to using an overly simplistic example, though for completeness it would still be reasonable to use both onchan and a nick checking regexp since they communicate to the command user the exact nature of an error.<br><br>Suppose I wanted to use a public command to send a network /WHOIS. In this case the target nick does not need to be in the command source channel. The target nick doesn't even need to be online since this would return a RAW 401 or 402 depending on the syntax of the /WHOIS command. In this case it might be useful to validate the target entered by the command user using the regexp.<br><br>Same question. Is it generally valid for common IRC networks?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Wed Sep 09, 2009 1:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2009-09-09T12:15:59-04:00</updated>

		<published>2009-09-09T12:15:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90192#p90192</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90192#p90192"/>
		<title type="html"><![CDATA[IRC nick regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90192#p90192"><![CDATA[
Why do you need a regexp? why not directly use [onchan] on the target?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Sep 09, 2009 12:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-09-09T06:45:26-04:00</updated>

		<published>2009-09-09T06:45:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90191#p90191</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90191#p90191"/>
		<title type="html"><![CDATA[IRC nick regexp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90191#p90191"><![CDATA[
I consistently use the following regexp in my scripts to validate a nick  entered with a command, for example !op &lt;nick&gt; to trigger a PUB bind that ops channel users.<br><div class="codebox"><p>Code: </p><pre><code>bind PUB o !op procnameproc procname {nick uhost hand chan text} {  set target [string trim $text]  if {[regexp -- {^[\x41-\x7D][-\d\x41-\x7D]*$} $target]} {    # normal code here  } else {    # error code here  }}</code></pre></div>This seems to work fine on the network I frequent but I have never really considered whether it is generally true for a wide range of IRC networks and, as a consequence, my scripts would not function as expected in other circumstances.<br><br>Is the regexp generally true or are there common networks that have other rules regarding the characters allowed in a nick?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Wed Sep 09, 2009 6:45 am</p><hr />
]]></content>
	</entry>
	</feed>
