0

I am trying to have an inbetween step for deleting words backwards, which should stop at a capital letter (in the case of camelCase).

For this I thought to use the following to obtain the position of the first capital letter backwards:

(search-backward-regexp "[:upper:]")

If you'd run this when point is after that last parenthesis, it will go here:

(search-backward-regexp "[:upper | :]"), that is, after the r.

How so?

4

3 回答 3

5

(向后搜索正则表达式“[[:upper:]]”)

[:upper:]还不是“上部”调用,而只是一个匹配单个字符的字符类,该字符必须是“:”或“u”或“p”或“e”或“r”之一。只有第二个“ []”使它搜索类。

于 2013-07-12T19:13:03.193 回答
1

安德烈亚斯的回答是正确的。但是,根据您要实现的目标,我建议您看一下subword-mode(它与 emacs 捆绑在一起,至少对于现代 emacsen 而言)

于 2013-07-15T07:27:22.460 回答
0

我现在意识到它与变量有关case-fold-search

当设置为 时t,它将忽略搜索中的大小写。

于 2013-07-12T17:57:35.077 回答