[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiple replacements in one regular expression?
From: |
Johan Vromans |
Subject: |
Re: Multiple replacements in one regular expression? |
Date: |
Wed, 21 Jan 2015 13:53:53 +0100 |
On Wed, 21 Jan 2015 11:23:40 +0100
Urs Liska <address@hidden> wrote:
> #(set! str
> (regexp-substitute/global #f "&" str
> 'pre "\\&" 'post))
>
> However, this approach will get quite cumbersome (and expensive) when
> there are numerous characters to be escaped. Therefore I'd like to know
> if I can "fold" them in one regular expression substitution.
I don't know what implementation of regular expression matching scheme
uses, but you should be able to specify a character set (group of
characters) to match, capture the matching character, and replace it by
itself with "\\" prepended.
-- Johan
- Multiple replacements in one regular expression?, Urs Liska, 2015/01/21
- Re: Multiple replacements in one regular expression?,
Johan Vromans <=
- Re: Multiple replacements in one regular expression?, Urs Liska, 2015/01/21
- Re: Multiple replacements in one regular expression?, Johan Vromans, 2015/01/21
- Re: Multiple replacements in one regular expression?, Sven Axelsson, 2015/01/21
- Re: Multiple replacements in one regular expression?, Urs Liska, 2015/01/21
- Re: Multiple replacements in one regular expression?, Urs Liska, 2015/01/21
- Re: Multiple replacements in one regular expression?, Johan Vromans, 2015/01/21