June 18, 2007
从今天开始, 我将陆陆续续把我所使用的一些软件都写出来, 算是一个总结吧。 也给需要用的朋友一个参考。
今天先介绍的一个是关于编写正则表达式的工具 — RegexBuddy。
说起正则表达式, 很多人可能都听说过, 但却不一定用过。 正则表达式在我的脑海中一直认为是一个很高深的东西, 这个东西用的好让你事半功倍, 用的不好让你事倍功半。 关键就一点, 看你用的如何。我一直有学习正则表达式, 但因为实在用的地方太少, 所以总是学了忘, 忘了继续学。 用《家有儿女》这部片子中刘星的话来说就是:“学了忘, 忘了学, 学了还得忘”。 我也正是这样, 因为用的地方太少, 所以学了还得忘, 我学正则表达式最后是从使用firefox的adblock扩展开始的, 如果你也用过这个扩展, 你应该能够体会到正则表达式的强大能力, 等会儿我会举例说明。 好了, 还是言归正传。
February 1, 2007
以前只知道用Lookahead,今天第一次遇到Lookbehind的实例。
下面这段摘自 regular-expressions.info (很好的一个正则站点):
Lookbehind has the same effect, but works backwards. It tells the regex engine to temporarily step backwards in the string, to check if the text inside the lookbehind can be matched there. (? matches a “b” that is not preceded by an “a”, using negative lookbehind. It will not match cab, but will match the b (and only the b) in bed or debt. (?<=a)b (positive lookbehind) matches the b (and only the b) in cab, but does not match bed or debt.


