table/proc use in regsub
Closed / Fixed218805ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:05:45
OriginalBugID: 2175 RFE
Version: 8.0p2
SubmitDate: '1999-06-03'
LastModified: '1999-08-06'
Severity: LOW
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: Other
OSVersion: NetBSD-1.3.3/i386
Machine: NA
FixedDate: '1999-08-06'
FixedInVersion: 8.1.1
ClosedDate: '2000-10-25'
Name:
Hume Smith
DesiredBehavior:
I'm often using regsub to do encodings and decoding, such as MIME
quoted-printable or URI %. I seem to get the best speed by using regexp
to protect \ $ and [, using it again to insert either $DEC(\&) or [foo
{\&}], then running the result through subst. It gets kind of icky.
How hard would it be to add, say, -eval and -table switches, where the
substitution pattern becomes an array name for -table and the match is
replaced with the mapping from the array, and for -eval the substitution
argument is the usual list which gets the match tacked on and evaluated
(in the same context as the regsub)? Any interest in something like
that?
This type of feature was added as [string map] in 8.1.1.
-- 08/06/1999 hobbs
welch Closed ticket [218805ffff].
[History diff]2000-10-26 08:29:16
dgp Open ticket [218805ffff].
[History diff]2001-04-16 20:25:01
dgp Closed ticket [218805ffff].
[History diff]2001-04-16 20:26:14
Log in (anonymous is fine) to add a comment.