<?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/15474" />

	<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>2008-03-03T14:09:44-04:00</updated>

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

		<entry>
		<author><name><![CDATA[tueb]]></name></author>
		<updated>2008-03-03T14:09:44-04:00</updated>

		<published>2008-03-03T14:09:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81398#p81398</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81398#p81398"/>
		<title type="html"><![CDATA[Error: &quot;quantifier operand invalid&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81398#p81398"><![CDATA[
I got the first result with unbalanced braces:<br><blockquote class="uncited"><div>[16:38] Mangling regexp: (1861 - 1865|1861?[ -]?1865</div></blockquote><br><br>but this time, the errorlog also stated:<br><blockquote class="uncited"><div>03/03/08@16:38.07&gt; : couldn't compile regular expression pattern: parentheses () not balanced</div></blockquote><br>-------<br>Edit:<br><blockquote class="uncited"><div>[22:18] Mangling regexp: (7 x|7|sieben)<br>[22:19] Last message repeated 1 time(s).<br>[22:19] Tcl error [moxquiz_pubm]: couldn't compile regular expression pattern: quantifier operand invalid<br>[22:19] couldn't compile regular expression pattern: quantifier operand invalid<br>    while executing<br>"regexp -nocase -- $answer $saveanswer"<br>    (procedure "moxquiz_pubm" line 668)<br>    invoked from within<br>"moxquiz_pubm $_pubm1 $_pubm2 $_pubm3 $_pubm4 $_pubm5"</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9349">tueb</a> — Mon Mar 03, 2008 2:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tueb]]></name></author>
		<updated>2008-03-03T06:07:38-04:00</updated>

		<published>2008-03-03T06:07:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81385#p81385</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81385#p81385"/>
		<title type="html"><![CDATA[Error: &quot;quantifier operand invalid&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81385#p81385"><![CDATA[
Thanks for your quick help!<br><br><br>nml375: I added the <em class="text-italics">putlog "Mangling regexp: $theq(Regexp)"</em>. Now I'll have to wait until the error occurs next.<br><br>DragnLord: Unfortunately the braces are used. For example: "Answer[ -]?(1|2)"<br><br><br>Thanks again,<br><br>tueb<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9349">tueb</a> — Mon Mar 03, 2008 6:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[DragnLord]]></name></author>
		<updated>2008-03-03T00:22:02-04:00</updated>

		<published>2008-03-03T00:22:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81383#p81383</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81383#p81383"/>
		<title type="html"><![CDATA[Error: &quot;quantifier operand invalid&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81383#p81383"><![CDATA[
you could remove the braces if they are not actually used<br>for regular braces:<div class="codebox"><p>Code: </p><pre><code>regsub -all -- {\[|\]} $theq(Regexp) {} theq(Regexp)</code></pre></div>for curly braces:<div class="codebox"><p>Code: </p><pre><code>regsub -all -- {\{|\}} $theq(Regexp) {} theq(Regexp)</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4461">DragnLord</a> — Mon Mar 03, 2008 12:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-03-02T17:13:44-04:00</updated>

		<published>2008-03-02T17:13:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81377#p81377</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81377#p81377"/>
		<title type="html"><![CDATA[Error: &quot;quantifier operand invalid&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81377#p81377"><![CDATA[
I am abit puzzled by the extensive mangling of the regular expression.<br>In any case, an invalid quantifier operand would suggest one of the below have been broken by the mangling:<blockquote class="uncited"><div>       A quantified atom is an atom possibly followed by a single quantifier.  Without a quantifier, it matches a match for the atom.   The  quantifiers,  and<br>       what a so-quantified atom matches, are:<br><br>         *     a sequence of 0 or more matches of the atom<br><br>         +     a sequence of 1 or more matches of the atom<br><br>         ?     a sequence of 0 or 1 matches of the atom<br><br>         {m}   a sequence of exactly m matches of the atom<br><br>         {m,}  a sequence of m or more matches of the atom<br><br>         {m,n} a sequence of m through n (inclusive) matches of the atom; m may not exceed n<br><br>         *?  +?  ??  {m}?  {m,}?  {m,n}?<br>               non-greedy  quantifiers,  which  match  the  same  possibilities, but prefer the smallest number rather than the largest number of matches (see<br>               MATCHING)</div></blockquote>It might be possible that there's an unmatched brace, as you suspect. There are, however numerous other ways it might be broken.<br>Try adding something like: <em class="text-italics">putlog "Mangling regexp: $theq(Regexp)"</em> just above the line: <em class="text-italics">if {[regexp -- $theq(Regexp) $subexp]} {</em><br>This should reveal the actual regular expression that is broken, might assist in figuring what's going wrong...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Mar 02, 2008 5:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tueb]]></name></author>
		<updated>2008-03-02T16:35:01-04:00</updated>

		<published>2008-03-02T16:35:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=81376#p81376</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=81376#p81376"/>
		<title type="html"><![CDATA[Error: &quot;quantifier operand invalid&quot;]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=81376#p81376"><![CDATA[
Hi,<br><br>I get the following error:<br><blockquote class="uncited"><div>couldn't compile regular expression pattern: quantifier operand invalid<br>while executing<br>"regexp -- $theq(Regexp) $subexp"<br>(procedure "moxquiz_ask" line 152)<br>invoked from within<br>"moxquiz_ask $botnick {} {} $quizconf(quizchannel) {}"<br>(procedure "mx_timer_ask" line 3)<br>invoked from within<br>"mx_timer_ask"</div></blockquote><br><br>This is the code:<br><div class="codebox"><p>Code: </p><pre><code># protect embedded numbersif {[regexp "\[0-9\]+" $theq(Regexp)]} {    set newexp ""    set oldexp $theq(Regexp)    set theq(Oldexp) $oldexp    while {[regexp -indices "(\[0-9\]+)" $oldexp pair]} {set subexp [string range $oldexp [lindex $pair 0]  [lindex $pair 1]]set newexp "${newexp}[string range $oldexp -1 [expr [lindex $pair 0] - 1]]"if {[regexp -- $theq(Regexp) $subexp]} {    set newexp "${newexp}(^|\[^0-9\])${subexp}(\$|\[^0-9\])"} else {    set newexp "${newexp}${subexp}"}set oldexp "[string range $oldexp [expr [lindex $pair 1] + 1] [string length $oldexp]]"    }    set newexp "${newexp}${oldexp}"    set theq(Regexp) $newexp    #mx_log "---- replaced regexp '$theq(Oldexp)' with '$newexp' to protect numbers."}</code></pre></div><br>If I understand corretly, the "$theq(Regexp)" includes braces, which aren't balanced. <br><br>Is there a way to prevent the bot from aborting the proc upon this error? I can't prevent the unbalanced braces in the file out of which the "$theq(Regexp)" is generated.<br><br>Thank you for your help,<br><br>tueb<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9349">tueb</a> — Sun Mar 02, 2008 4:35 pm</p><hr />
]]></content>
	</entry>
	</feed>
