Skip to content
Tcl Source Code Artifact [9f3d9987aa]
Login

Artifact [9f3d9987aa]

Artifact 9f3d9987aa7c06a7ef163341f36907739e1f9620:

Ticket change [9f3d9987aa] - New ticket [3106532fffffffff|3106532fff] <i>&quot;switch -regexp -indexvar&quot; gives invalid range</i>. by martinlemburg on 2010-11-10 08:27:35.
D 2010-11-10T08:27:35
J assignee dkf
J cmimetype text/plain
J comment In\sTIP\s#75\sis\stold,\sthat\sthe\snew\s-indexvar\soption,\srelated\sto\sthe\s-regexp\soption\sof\sswitch,\sshould\sbehave\slike\sin\sthe\s-indices\soption\sin\sthe\sregexp\scommand\sto\sreturn\sthe\srange\sof\sthe\sfound\smatche\sand\sthe\sranges\sof\sthe\ssub\smatches\sfor\sany\ssub\sexpression.\nThe\sman\spage\spoints\sto\s"regexp\s-indices",\stoo,\sbut\stells\sthe\sindex\svariable\scontains\srange(s)\sfrom\sthe\sfirst\smatching\scharacter\sto\sthe\snext\safter\sthe\slast\smatching\scharacter.\n\nSo\s-\sTIP\s#75\sis\snot\srealized\sand\sthe\sbehavior\sof\s"switch\s-regexp\s-indexvar"\sis\snot\scomparable\sto\s"regexp\s-indices".\n\nAn\sexample:\n\n\s\s\s\s%\sswitch\s-regexp\s-indexvar\si\s-matchvar\sm\s"abcdef"\s{\n\s\s\s\s\s\s\s\s^abc\s{\n\s\s\s\s\s\s\s\s\s\s\s\sputs\s"matchvar\s=\s'$m'";\n\s\s\s\s\s\s\s\s\s\s\s\sputs\s"indexvar\s=\s[list\s$i]";\n\s\s\s\s\s\s\s\s\s\s\s\sputs\s"string\srange\s=\s'[string\srange\s"abcdef"\s{*}[lindex\s$i\s0]]'";\n\s\s\s\s\s\s\s\s}\n\s\s\s\s}\n\s\s\s\smatchvar\s=\s'abc'\n\s\s\s\sindexvar\s=\s{{0\s3}}\n\s\s\s\sstring\srange\s=\s'abcd'\n\s\s\s\s%\sstring\srange\s"abcdef"\s{*}[lindex\s[regexp\s-indices\s-inline\s{^abc}\s"abcdef"]\s0]\n\s\s\s\sabc\n\nThis\sbehavior\sshould\sbe\sconsistent\sand\sbe\scorrected\sfor\sthe\sswitch\soption\s-indexvar!
J foundin obsolete:\s8.5.9
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter martinlemburg
J subsystem 18.\sCommands\sM-Z
J title "switch\s-regexp\s-indexvar"\sgives\sinvalid\srange
J type Bug
K 3106532fffffffffffffffffffffffffffffffff
U martinlemburg
Z 8409d4905724ec27c17d970e5ad52816