Zdenek Sekera wrote:
I have this:

if (char =~ '\m[;|<>?:[EMAIL PROTECTED]&*(){}\\_+-[\]/\"]')
  do something
endif

Basically it is checking for all non-alphanumeric chars
(expect '=').

1. how do I include the "'" char?.
   I can't seem to find a proper way.
   (I'd like to keep the patter in enclosed in '...')

2. why when the pattern ends with '+' or '\+' do I get
   an error?

---Zdenek


1. Starting with version 7, you can have a single quote in a single-quoted string by doubling the single quote. Thus, '''' (four single quotes) represents one single quote and 'a''b' (quote a quote quote b quote) is a string consisting of the letters a and b with a single quote between them.

In all versions, you can concatenate strings, and a single quote can be enclosed in a double-quoted string. Thus, '"' . "'" (single double single space dot space double single double) is an expression whose value is a String consisting of a double quote followed by a single quote.

2. I don't know, but I think it's either a bug, or documented under ":help pattern.txt" somewhere.


Best regards,
Tony.

Reply via email to