-1 有更新
1. 中文化
2. 可調整大小
3. 有個下拉框 可以選擇常用的表達式
4. 玩死人的正則表達式 來解析一個文本格式 好過引
5. 改了圖標
-0.1 圖片:


-0.2 exe 下載: http://mregtest.googlecode.com/files/MRegTest%20v0.1.7z
-0.3 小程序功能有限 非常非常的有限 沒什么說的
程序有些好玩
有個配置的文本
格式是這樣的 我的小程序會解析的這樣的文本
id 0.IP Adress
{
source text = "127.0.0.1";
regex text = "(\d+).(\d+).(\d+).(\d+)";
replace text = "";
};
代碼是這樣的: 1 const wregex rex(L"id\\s+[0-9]+\\.(.*)\\s*\\{\\s+source\\s+text\\s*=\\s*\"(.*)\";\\s*\\s+regex\\s+text\\s*=\\s*\"(.*)\";\\s*\\s+replace\\s+text\\s*=\\s*\"(.*)\";\\s*\\};");
2
3
4 wstring::const_iterator text_beg = text.begin();
5 wstring::const_iterator text_end = text.end();
6 wsmatch rmatch;
7 while( regex_search(text_beg,text_end,rmatch,rex))
8 {
9 room lroom;
10 if( rmatch.size() == 5)
11 {
12 lroom.name = rmatch[1].str();
13 lroom.source_text = rmatch[2].str();
14 lroom.regex_text = rmatch[3].str();
15 lroom.replace_text = rmatch[4].str();
16 rooms.push_back(lroom);
17 }
18 text_beg = rmatch[0].second;
19 }
2
3
4 wstring::const_iterator text_beg = text.begin();
5 wstring::const_iterator text_end = text.end();
6 wsmatch rmatch;
7 while( regex_search(text_beg,text_end,rmatch,rex))
8 {
9 room lroom;
10 if( rmatch.size() == 5)
11 {
12 lroom.name = rmatch[1].str();
13 lroom.source_text = rmatch[2].str();
14 lroom.regex_text = rmatch[3].str();
15 lroom.replace_text = rmatch[4].str();
16 rooms.push_back(lroom);
17 }
18 text_beg = rmatch[0].second;
19 }
-0.4 是不是很好玩呢?
相關分解可以查看源碼 alway_regex_fuck.txt
-0.5 還有回車鍵禁了 回車不會關閉對話框
0. 標題: 小小小小開源正則表達式測試工具
1. 前言: C++標準庫 有正則表達式支持了
vs2008 sp1 里有 在命名空間 std::tr1里
2. 正文: 這個正則表達式是大話題 我就不多說了
有道是 編程不懂正則 不如回家種番薯
3. 附錄: 匹配 數字 [0-9] or \d
匹配 空白的 [ \t\r\n] or \s
匹配 字符 [A-Za-z] or \w
4. 附錄2: 地址開源在這里 http://code.google.com/p/mregtest/
5. 附錄3: 截圖:
6. exe下載: 正則表達式小小小工具 http://mregtest.googlecode.com/files/MRegTest.exe