Skip to content
Tcl Source Code Artifact [d94b2416e3]
Login

Artifact [d94b2416e3]

Artifact d94b2416e3ac63923b4d76cd9ed60867f3fa7460:

Ticket change [d94b2416e3] - New ticket [652953ffffffffff|652953ffff] <i>regsub -code (equivalent to Perl&#39;s /e)</i>. by nobody on 2002-12-12 21:51:56.
D 2002-12-12T21:51:56
J assignee dkf
J cmimetype text/plain
J comment (Greg\sBeauchesne,\[email protected])\n\nI\shope\sI\sdidn't\smiss\ssomething,\sbut\sI\swanted\san\soption\nin\s"regsub"\sthat\swas\sequivalent\sto\sPerl's\s/e\smodifier\non\ssubstitutions,\sand\sI\scouldn't\sfind\sone.\s/e\sin\sPerl\nevaluates\sthe\ssubtitution\sstring\sas\scode\srather\sthan\sas\njust\sa\sstring.\sSo,\sI\sadded\sa\s-code\sflag\sto\s"regsub"\sfor\nthis\spurpose.\n\nFor\sexample,\sto\sdecode\sa\sURL-encoded\sstring,\syou\scan\sdo:\n\nregsub\s-nocase\s-all\s-code\s--\s{%([0-9a-f]{2})}\s$string\n{format\s%c\s0x$1}\n\nDuring\sthe\ssubstitution\scode,\sthe\svariables\s$0,\s$1,\s$2,\netc.\sare\sset\sto\sthe\smatch.\sIf\sthere\swere\sactual\nvariables\s$0,\s$1,\s$2,\setc.\sbeforehand,\sthey\sare\nrestored\sat\sthe\send\sof\sthe\sregsub\scommand,\sbut\sthey\sare\nnot\saccessible\sduring\sthe\scode\sexecution.\sMatches\swhich\nare\sunused\sare\sset\sto\sempty\sstrings\s(to\savoid\serrors).\nThe\sreplacement\sis\sdone\sfor\sTCL_OK\sand\sTCL_RETURN\ncodes.\sTCL_BREAK\swill\sstop\sreplacement\sprematurely\s(Not\nmuch\suse\swithout\s-all)\sand\sTCL_ERROR\sor\sTCL_CONTINUE\nwill\scause\sthe\scommand\sto\sreturn\sTCL_ERROR.
J foundin None
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 18.\sCommands\sM-Z
J title regsub\s-code\s(equivalent\sto\sPerl's\s/e)
J type RFE
K 652953ffffffffffffffffffffffffffffffffff
U nobody
Z dee293f05c217d54ba9084986642bef5