[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unquoted special characters in regexps
From: |
Luc Teirlinck |
Subject: |
Re: Unquoted special characters in regexps |
Date: |
Fri, 3 Mar 2006 17:00:40 -0600 (CST) |
Martin Rudalics wrote:
Nowadays I'd probably write something like
"[^\\]\\(\\\\\\{2\\}*\\)\"[ \t,]*"
but maybe at the time the original expression was written repetition
operators were not yet available.
To me, the above regexp is _really_ awkward, whereas
"[^\\]\\(\\([\\][\\]\\)*\\)\"[ \t,]*"
is really easy to understand and very self-documenting.
However, writing `[\\]' to match a single backslash is dreadful as well.
Quite to the contrary. It documents very clearly which \\ together
represent one single literal backslash and it separates them clearly
from the surrounding non-literal backslashes. It is what makes this
regexp so very easy to read, unlike your suggested replacement with
its six consecutive ungrouped backslashes, with various different
meanings.
Sincerely,
Luc.
- Re: Unquoted special characters in regexps, (continued)
- Re: Unquoted special characters in regexps, Luc Teirlinck, 2006/03/01
- Re: Unquoted special characters in regexps, Richard Stallman, 2006/03/02
- Re: Unquoted special characters in regexps, Luc Teirlinck, 2006/03/02
- Re: Unquoted special characters in regexps, Richard Stallman, 2006/03/02
- Re: Unquoted special characters in regexps, martin rudalics, 2006/03/02
- Re: Unquoted special characters in regexps, Luc Teirlinck, 2006/03/02
- Re: Unquoted special characters in regexps, martin rudalics, 2006/03/03
- Re: Unquoted special characters in regexps, Luc Teirlinck, 2006/03/03
- Re: Unquoted special characters in regexps, martin rudalics, 2006/03/03
- Re: Unquoted special characters in regexps, Luc Teirlinck, 2006/03/03
- Re: Unquoted special characters in regexps,
Luc Teirlinck <=
- Re: Unquoted special characters in regexps, Luc Teirlinck, 2006/03/04
- Re: Unquoted special characters in regexps, Richard Stallman, 2006/03/04
- Re: Unquoted special characters in regexps, martin rudalics, 2006/03/03
- Re: Unquoted special characters in regexps, Richard Stallman, 2006/03/04
- Re: Unquoted special characters in regexps, martin rudalics, 2006/03/04
- Re: Unquoted special characters in regexps, Richard Stallman, 2006/03/05
- Re: Unquoted special characters in regexps, Richard Stallman, 2006/03/04
- Re: Unquoted special characters in regexps, martin rudalics, 2006/03/04
- Re: Unquoted special characters in regexps, Luc Teirlinck, 2006/03/03
- Re: Unquoted special characters in regexps, martin rudalics, 2006/03/04