[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: |
Sun, 26 Feb 2006 12:22:44 -0600 (CST) |
Martin Rudalics wrote:
> Apart from correcting the bug we are discussing, it also corrects
> another misstatement:
>
> For example, a string with unbalanced square brackets is invalid
> (with a few exceptions, such as `[]]'),
>
> That is incorrect as the examples below show.
>
> ELISP> (string-match "]]]]" "]]]]")
> 0
> ELISP> (string-match "[[]" "[")
> 0
Your example doesn't show that. You reason about validity in presence
of a sentence like
*Please note:* For historical compatibility, special characters
are treated as ordinary ones if they are in contexts where their
special meanings make no sense.
You are confusing validity with meeting stylistic guidelines. The
fact that string-match returns 0 instead of throwing an error shows
that the regexps are valid. "*", "." and so on are valid regexps too,
even though they violate stylistic guidelines. "[" is _not_ a valid
regexp.
You can change stylistic guidelines by making doc changes. You can
only change what is valid by making code changes.
Sincerely,
Luc.
Message not available
Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Re: Unquoted special characters in regexps, Richard Stallman, 2006/03/04
- 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