I need some help with multiple successive "patsubst" statements.

I have a string of text like "Grant Taylor's Blog (:test:)" (accessible to a macro as $2) that I need to escape spaces, apostrophes, colons, and parenthesis. I need the output of the above string to be "Grant\ Taylor\'s\ Blog\ \(\:test\:\)".

I can get patsubst to replace one or more occurrences of any single character. But I can't seem to get things correct to replace (escape) multiple different characters.

I have looked at the documentation of translit and think that it would handle multiple characters, but I don't see how to add the leading forward slash to escape said characters.

I think I could do what I want to do with the following regular expression in sed. But I want to do this in m4, for various reasons.

s/\([ :()]\)/\1/g



--
Grant. . . .
unix || die

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to