Thursday, December 8, 2016

Re: discrepancy in regular expression match using bufdo command

On 2016-12-08, sinbad wrote:
> No, i didn't. Is it the same case with all other scripting languages too ?
> I just found overloading to be counter intuitive. There seem to be a good
> reason for doing so, which i'm missing.

I think what you may be missing is that the backslash is not being
overloaded. Its meaning is consistent. It gives special meaning to
the character following it. Or it removes special meaning from the
character following it when that character already has a special
meaning. When you want a backslash to just be a backslash, you
escape or quote it by preceding it with the escape character,
another backslash.

For example, in most regular expression languages, a period (.)
means "any character". If you want a literal period, you precede
the period with a backslash:

\.

As another example, the letter n by itself means just the letter n.
Preceding it by a backslash means the two characters are to be
interpreted as the single character newline.

I don't know of any especially good explanations of this, but the
QUOTING section of the bash man page provides a decent explanation.

Regards,
Gary

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: