Skip to content
Tcl Source Code Artifact [a054c3c46e]
Login

Artifact [a054c3c46e]

Artifact a054c3c46ec5bfae7dd4c7f8a72be0068065bc99:

Ticket change [a054c3c46e] - Ticket [906616ffffffffff|906616ffff] <i>lsearch -regexp error introduced in 8.4.2</i> status still Closed with 4 other changes by rickmacd on 2004-03-03 03:11:29.
D 2004-03-03T03:11:29
J icomment Logged\sIn:\sYES\s\nuser_id=493198\n\nI\shadn't\srealized\sthat\ssearching\san\sempty\slist\sin\smy\sexample\nmade\sa\sdifference.\n\nI\slooked\sagain,\sand\swith\sa\scloser\sexample\sto\swhat\smy\sapp\sis\ndoing\sI\ssee\sthat\sit\sworked\sin\stcl8.0\sbut\sfails\sas\sof\stcl8.2.\nI\sdon't\shave\s8.1\shandy.\n\nI've\srestated\san\sexample\shere\sto\smake\sit\smore\sclear\sthat\nwhat\sI\sam\sdoing\sis\ssearching\sa\slist\sof\slists\sto\smatch\swith\sa\nlist\selement.\sI'm\susing\s-regexp\sto\sanchor\sthe\smatch\sat\sthe\nbeginning.\sIn\smy\smind,\s"^myelement"\sis\sa\ssimple\srexexp\sof\nthe\sanchor\s"^"\sfolowed\sby\ssome\sdata\sthat\sis\s"unfortunately"\nbeing\scontrued\sas\spart\sof\sthe\sregexp\sitself.\n\nI\scan\scertainly\saccept\sit\sif\syour\sanswer\sis\sthat\stcl\sis\nbehaving\sas\sdesired\sand\sexpected,\sbut\sif\syou\sdon't\smind\nplease\sconfirm\sthis\sin\slight\sof\sthe\srevised\sexample\shere.\sI\ndo\sunderstand\sthat\safter\sparsing,\sall\smy\sexamples\sare\nprobably\sseen\sthe\ssame\sby\stcl.\sI\swouldn't\shave\sthought\sthis\na\sbug\sif\sit\shad\soriginally\sfailed\syears\sago\swhen\sthe\scode\nwas\sfirst\swritten.\n\nIf\sthere\sis\sno\sbug\shere\sI\shave\ssome\srefactoring\sto\sdo.\sIn\nsome\scases\sI\scan\suse\s-exact,\sotheres\s-glob,\sbut\sin\ssome\sI'll\nhave\sto\sloop\sthrough\sand\scompare\seach\selement\smanually.\sOr,\ncan\sanybody\ssee\sany\sclever\squoting\sthat\scould\sbe\sdone\sto\sthe\nlsearch\sbelow\sso\sthat\s$myelement\sis\snot\sseen\sas\spart\sof\sthe\nregexp?\n\ntclsh8.0\n%\sset\smylist\s[list\s[list\s[list\s3\s5]\s1\s3]\s[list\s[list\s4\s6]\s4\s6]]\n{{3\s5}\s1\s3}\s{{4\s6}\s4\s6}\n%\sset\smyelement\s[list\s[list\s4\s6]]\n{4\s6}\n%\slsearch\s-regexp\s$mylist\s^$myelement\n1\n%\s\n\ntclsh8.4\n%\sset\smylist\s[list\s[list\s[list\s3\s5]\s1\s3]\s[list\s[list\s4\s6]\s4\s6]]\n{{3\s5}\s1\s3}\s{{4\s6}\s4\s6}\n%\sset\smyelement\s[list\s[list\s4\s6]]\n{4\s6}\n%\slsearch\s-regexp\s$mylist\s^$myelement\ncouldn't\scompile\sregular\sexpression\spattern:\squantifier\noperand\sinvalid\n\n"-glob"\sworks\sfor\sthis\sparticular\scase:\n%\slsearch\s-glob\s$mylist\s$myelement*\n1\n\n
J login rickmacd
J mimetype text/plain
J username rickmacd
K 906616ffffffffffffffffffffffffffffffffff
U rickmacd
Z 3aa03008a10b088f10efa79a09fafb64