Despite my better judgement for helping you, most likely your problem stemmed from you trying it with curly braces and not quotes.rosc2112 wrote:>> You've embedded unescaped control-codes to handle the bold rather than the proper escape sequence \002. Synonyms and antonyms suffer from this.
Ahh ok.. As I recall, trying to use escape codes in a regsub using the & subs, doesn't work, hence having to use embedded code (which I generally dislike and avoid, however it didn't work for this case, iirc.)
Code: Select all
regsub -all -nocase "<b>.*?</b>" $dcsynon "\002&\002" dcsynon
It wasn't my problem, as I said, my script works without error for me. Other people can feel free to implement the fix you posted. When crafting this script, I used the regsub manpage provided with tcl, following the "accepted standard."strikelight wrote:Despite my better judgement for helping you, most likely your problem stemmed from you trying it with curly braces and not quotes.
It wasn't my problem, as I said, my script works without error for me. Other people can feel free to implement the fix you posted. When crafting this script, I used the regsub manpage provided with tcl, following the "accepted standard."strikelight wrote:Despite my better judgement for helping you, most likely your problem stemmed from you trying it with curly braces and not quotes.
What you quoted me saying was infact in response to a direct quote of you acknowledging something not working for you (& with escaped codes). Thus, by definition, you had a "problem".rosc2112 wrote:It wasn't my problem, as I said, my script works without error for me. Other people can feel free to implement the fix you posted. When crafting this script, I used the regsub manpage provided with tcl, following the "accepted standard."strikelight wrote:Despite my better judgement for helping you, most likely your problem stemmed from you trying it with curly braces and not quotes.
Actually, according to the "rules of the land", you must seek permission from the original author first.rosc2112 wrote: If you have a personal problem with offering me help (presumably because I "dared" to fix one of your scripts - and posted it according to the rules of the tcl archive with a name indicating it was a modified version, eg, script-version-rosc) you really don't need to.
Code: Select all
# above code
regsub -all -nocase {(?:<b>|</b>)} $dcsynon "\002" dcsynon
# below code
regsub -all -nocase {<b>.*?</b>} $dcsynon {*control-code 002 is embedded here*&*control-code 002 is embedded here*} dcsynon