0

我想改变这个:

_(with(new FuListNode )->isList())->shouldBe(true);
_(with(new FuListNodes)->isList())->shouldBe(false);
_(with(new FuTreeNode )->isList())->shouldBe(true);
_(with(new FuTreeNodes)->isList())->shouldBe(false); } }

对此(看看最后的布尔值):

_(with(new FuListNode )->isList())->shouldBe(false);
_(with(new FuListNodes)->isList())->shouldBe(true);
_(with(new FuTreeNode )->isList())->shouldBe(false);
_(with(new FuTreeNodes)->isList())->shouldBe(true); } }

我正在使用 TextMate,如何通过一次查找/替换干净地做到这一点?

4

3 回答 3

1

它不能使用单一的搜索和替换来完成。

于 2009-10-15T05:57:33.840 回答
0

你能做这个吗?

s/true|false/!&/
于 2009-10-15T02:07:56.713 回答
0

我从来没有使用过TextMate,但你不能做这样的事情吗?

1. Replace all "true" with some dummy value, say "hello"
2. Replace all "false" with "true"
3. Replace all "hello" with "false"

当然,这涉及 3 个查找替换,而不是您要求的 1 个。

于 2009-10-15T05:30:44.557 回答