Overview
| Artifact ID: | a3f46d26f5a2949271fcdee3db83a321c9233cc4 |
|---|---|
| Ticket: | 3063568fffffffffffffffffffffffffffffffff
regsub example doesn't perform as advertized |
| User & Date: | dkf on 2010-09-10 19:55:19 |
Changes
- icomment:
Updated example text is as below. # This RE is just a character class for almost everything "bad" set RE {[][{};#\\\$ \r\t\u0080‐\uffff]} # We will substitute with a fragment of Tcl script in brackets set substitution {[format \\\\u%04x [scan "\\&" %c]]} # Now we apply the substitution to get a subst‐string that # will perform the computational parts of the conversion. Note # that newline is handled specially through string map since # backslash‐newline is a special sequence. set quoted [subst [string map {\n {\\u000a}} \ [regsub -all $RE $string $substitution]]] - login: "dkf"
- mimetype: "text/plain"
- username: "dkf"