文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>SI+GCC

SI+GCC

时间:2010-07-15  来源:chiang

今天搞了一下Source Insight,好久没在家里用了,今天配置了一下编译器,安装了MINGW,以后在家写东西就用这个了,我用的版本是mingw32-gcc-3.4.5 + source insight 3.5   找了个正则表达式,用来解析编译结果:^\([a-zA-Z].*\):\([0-9][0-9]*\)   稍微解释一下: ^\([a-zA-Z].*\):\([0-9][0-9]*\) //这个表达式就是搜索是否存在类似  xxxx:12 这样的组合   gcc编译结果类似于: F:\prj\DataStructLib\list\v_list.h:23: error: syntax error before "ulPrio"     Source insight规定Regular Expression Groups是\( and \)之间的表达式,详细的说明如下:   Regular Expression Groups

\( and \)

Parts of a regular expression can be isolated by enclosing them with \( and \), thereby forming a group. Groups are useful for extracting part of a match to be used in a replacement pattern. Each group in a pattern is assigned a number, starting with 1, from left to right.

Example: abc\(xyz\) matches abcxyz. xyz is considered group #1.

This is not all that useful, unless we are using the Replace command. The replace string can contain group characters in the form of \<number>. Each time a group character is encountered in the replacement pattern, it means “substitute the group value from the matched pattern”.

Example 1: replace \(abc\)\(xyz\) with \2\1. This replaces the matched string abcxyz with the contents of group #2 xyz, followed by the contents of group #1 abc. So abcxyz is replaced with xyzabc. This is still not too amazing. See the next example.

Example 2: replace \(\w+\)\(.*\)ing with \1\2ed. This changes words ending in ing with the same word ending with ed. Your English teacher would not be too happy.

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载