In article
<
a81653bf-f4f0-4532...@googlegroups.com>,
Arjen Markus <
arjen.m...@gmail.com> wrote:
> > this looks like a simple *regsub* job like:
> >
> > > regsub -all {_(\w)} "config_error_text" {\1??}
> >
> > but as you see I can not uppercase the '\1' to just do the job I want.
> > I cant even call a *proc* in the *{\1??}* to do an arbitrary
> > post-processing.
> >
> >
> > mfg
> If I remember correctly, Tcl 8.7 does allow you to specify a procedure like
> that.
Making every conceivable and inconceivable (and I do know its
meaning) edit possible results in a bloat of never used options.
while {[regexp {^(.*)_(¥w)(.*)$} $string - pre letter post]} {
set string $pre[string toupper $letter]$post
}
And if I do uae this pattern a lot:
proc regall {string re args} {
set script [lindex $args end]
set vars [lrange $args 0 end-1]
while {[llength [set vals [regexp -inline $string $re]]]}
{
uplevel 1 [list lassign [lrange $vals 1 end] $vars]
set string [uplevel 1 $script]
}
return $string
}
regall $string {^(.*)_(¥w)(.*)$} pre letter post {concat
$pre[string toupper $letter]$post]}
--
:-<> Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted. @
'I desire mercy, not sacrifice.' /|¥
Discordia: not just a religion but also a parody. This post / ¥
I am an Andrea Chen sockpuppet. insults Islam. Mohammed