[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: convert: properly escape some single-backslashes. (issue2401042)
From: |
Graham Percival |
Subject: |
Re: convert: properly escape some single-backslashes. (issue2401042) |
Date: |
Wed, 13 Oct 2010 04:28:57 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Tue, Oct 12, 2010 at 05:17:44PM +0100, Phil Holmes wrote:
> <address@hidden> wrote in message
> news:address@hidden
> >On 2010/10/11 18:18:37, dak wrote:
> >>python/convertrules.py:2992: _ ("\\RemoveEmpty*StaffContext -> \*Staff
> >>\\RemoveEmptyStaves"))
> >>Any particular reason that \*Staff does not get the backslash doubled
> >as well?
> >
> >The reason was that I didn't know what \* did -- I'm guessing it has a
> >special meaning in regex -- so I thought I should leave it alone.
>
> * has a special meaning in a regex - repeat the preceding class zero
> or more times - so it has to be escaped with a backslash in a regex.
Thanks!
So that's a good reason to avoid writing \\*Staff -- we don't want
a literal \ in the output, and we do want a literal *Staff.
Cheers,
- Graham