Re: [戰文!?] Regular Expression的中譯

看板Linux作者時間16年前 (2010/01/16 18:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串8/9 (看更多)
※ 引述《zxvc.bbs@ptt.cc (執著)》之銘言: > http://mitpress.mit.edu/books/FLAOH/cbnhtml/glossary-R.html > Regular Expression A definition for a class of strings that can be > recognized by a finite-state automaton. An example of a class of strings that > is regular would be legal mathematical expressions using only ``+'' and > digits. An example that is not regular is the same legal mathematical > expressions as before, but with properly nested parentheses. > Ex1: > 1+2+3 > 1+2 > +1+2 > ... > Python RegExp: > import re > print re.match("\+?\d?[\+\d]*", "1+2+3").group(0) > Ex2: > (1+2) > ((1)+2) > (((1))+2) > (1+(2)) > (1+((2)+(3))) > ... > 請高手找出剛好match它們的RegExp!? > 所以簡單的說regular不是指什麼正不正統, > 而是指你能不能找到一個pattern match一組字串。 > 沒有"規律"的字串組,是找不到對應的pattern! 正規表示法 符合規則的表示法 類似 正規軍 正規課程 正規矩陣 -- ※ Origin: SayYA 資訊站 <bbs.sayya.org> ◆ From: 114-32-29-34.hinet-ip.hinet.net
文章代碼(AID): #1BKPMY3D (Linux)
討論串 (同標題文章)
文章代碼(AID): #1BKPMY3D (Linux)