另外附上另外一個玩具 The Regulator 的介紹 以及下載
: O8 J' c" R; G+ f/ o3 G8 i9 s& ~7 e9 P+ c, r6 w
The Regulator 輕鬆上手
" }( Z: i# d! _- l 正則表達式的概念和作用就不多說了。正則表達式不好寫(不好想),所以有很多玩具來幫助我們寫正則表達式,The Regulator 就是其中的佼佼者(被列入MSDN上的知名文章: H/ g) t( Z' X q
《Ten Must-Have Tools Every Developer Should Download Now》); i. @) J. Q1 P5 R# f
。 The Regulator官方網站
/ g5 z$ q+ t) o1 e7 w! Y$ k% jhttp://royo.is-a-geek.com/iserializable/regulator/ T8 O. a/ l3 p0 R+ W6 w) F3 A
。最新版本為2.0.3。本文對The Regulator 的使用作一個簡單介紹。 & u# T/ }: l$ R" B% Q7 e) a L( g

5 Z8 ^) m6 P/ S" A0 H, E% W
4 n' Y Q9 m* Q/ b' }% h$ j The Regulator窗口主要分為六部分:Web Search、Regex Analyzer、SnippetsControl、表達式輸入區、Match結果區、待解析文本區。比較重要的是Regex Analyzer、表達式輸入區、Match結果區、待解析文本區。在默認情況下,Web Search區佔了很大位置,可能需要調整一下。 2 y- f; E' D8 h0 p. P3 o9 X* U
基本用法:在表達式輸入區、待解析文本區 輸入你心目中的表達式和待解析文本,然後點菜單欄中的Match,結果會顯示在Match結果區。
6 o; j5 [( }) @7 M# b+ V" @ 如果你想弄清楚一個正則表達式的意思,可以利用Regex Analyzer(在View菜單),不過該功能有時候無法解析出結果,此時可以把表達式輸入區 或者 待解析文本區 中的內容稍微改一下(比如添加一個空格),或許就可以解析出正確的結果了。比如我輸入 \d{2}-\d{5} ,會解析出 Any digit Exactly 2 times - Any digit Exactly 5 times 。可以幫助我們理解一個複雜的正則表達式。
* A9 \- j5 ?+ u) y) |0 J8 t 其他有用的功能:生成代碼(C# or VB.NET)、直接編譯成DLL、從網站檢索現成的正則表達式 (Web Search)、保存常用的表達式(SnippetsControl)等等 。
7 w; }, _/ |: A9 C6 I2 | 說到正則表達式,還有一個玩具很有名氣:Expresso
5 [& ]' x4 s7 _% e, b$ M8 ~http://www.ultrapico.com/
# @# J7 w3 t2 K$ V: o! Q。這個玩具在codeproject上有詳細介紹,出品時間也比The Regulator早。The Regulator的作者也受到了Expresso 的影響,才開發的The Regulator。他在The Regulator的幫助文件中說:「The Original idea for The Regulator came from a simple Regex Tester called " ^, j/ d' Q; u# ^, [7 I/ m
[FONT-COLOR=#0000ff]Expresso[/FONT-COLOR]: X6 S% W' D' R" }; D' _
". It was simple and easy to use (to a certain degree), but it mainly prompted the idea in me that I could build something similar with features that I wished I had. 7 b- D, h6 E" x1 ^- S0 p( G! A% F
So thanks, Expresso. Couldn't have done this one without ya! 」
( p) m4 E! C5 f) o& g6 `3 M' C
* W X' o& c' B+ V7 ]# z1 l[ 本帖最後由 84542649 於 2006-9-1 16:28 編輯 ]
q3 F7 y+ s: J" F4 X) o+ L& [8 X- {8 B+ {' q
附件: 用於生成正則表達式 Expresso 2.1.rar (2006-9-1 12:55, 303.79 K)
( _- K6 |5 ]. \. M4 K' J該附件被下載次數 93% `9 L5 ]6 s, b7 V, ?
! b A# p- T, g/ D. s6 c7 n8 `+ ~
1 e4 D' b) L% i) W# c
附件: Regulator.201.part01.rar (2006-9-1 15:06, 1000 K)
`) ^, q1 n, q3 J6 }該附件被下載次數 31
, @( X9 y! {, V c" [0 Z8 u0 j) w9 \ N. t1 l
0 C' W. ^1 @( R( o; l) V
附件: Regulator.201.part02.rar (2006-9-1 15:06, 1000 K). b6 O* q' n, y
該附件被下載次數 30# B$ I1 \: ~8 i7 d8 q1 G1 s
$ W9 }! x* g0 s$ a m( f
! I1 x K' M8 Y# Q# ~0 u U. l
附件: Regulator.201.part03.rar (2006-9-1 15:06, 707.73 K). R+ h7 M4 V; u" B
該附件被下載次數 31
4 ^+ x" c& {; Y# W! w6 X8 j0 j% x: t+ y# V2 s. E$ ?) a- L
" d5 F5 g+ c# C- P/ N
附件: Regulator2Help.zip (2006-9-1 16:28, 314.69 K) |
|