亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? regexp.shtml

?? mfc資源大全包含MFC編程各個方面的源碼
?? SHTML
?? 第 1 頁 / 共 2 頁
字號:
<HTML><HEAD>   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">   <META NAME="Author" CONTENT="Guy Gascoigne - Piggford">   <TITLE>Regex - An alternative Regular Expression Class</TITLE></HEAD><body background="../fancyhome/back.gif" bgcolor="#FFFFFF" link="#B50029" vlink="#8E2323" alink="#FF0000" bgproperties="fixed"><table WIDTH="100%"><tr WIDTH="100%"><td align=center><!--#exec cgi="/cgi/ads.cgi"--><td></tr></table><CENTER><H3><FONT COLOR="#AOAO99">An alternative Regular Expression Class</FONT></H3></CENTER><CENTER><H3><HR></H3></CENTER><p>This article was contributed by <a href="mailto:guy@wyrdrune.com">Guy Gascoigne -Piggford</a></p><p>This is another regular expression library. Like Zafir's it is based upon the work ofHenry Spencer. I started using this a long time ago and called my class <tt>Regexp</tt>(rather than <tt>CRegExp</tt>). Actually I prefer Zafir's name but I have too much codeusing the other name to want to change it, so right now my class is called <tt>Regexp</tt>(change it if you like).</p><p>So why put up another version? I hear you ask. Well the two classes took the same basecode and then developed to solve different problems. <tt>CRegExp</tt> is geared to Searchand Replace operations whereas <tt>Regexp</tt> was written to simplify tokenisation. Iwanted a class that could be given a 'program' and from that, return specific substringsfrom it's input. Regular expressions may not be the fastest way to parse input (thoughwith careful anchoring they can be made so that they fail quickly if they are going to)but once you have a working library they do allow for fairly rapid coding. On the wholethis is good enough, worry about making it faster once you have it working and actuallyknow that your optimization effort isn't going unnoticed.<font SIZE="2"></p><p></font>For example:</p><pre><tt>Regexp re( &quot;^[\t ]*(.*)[\t ]*\\((.*)\\)&quot; );CString str( &quot;wyrdrune.com!kelly (Kelly)\n&quot; );CString name, addr;if ( re.Match( str ) &amp;&amp; re.SubStrings() == 2 ){	name = re[2];	addr = re[1];}</pre></tt><p><tt>Will give:</tt></p><p><tt>name == &quot;Kelly&quot; and addr == &quot;wyrdrune.com!kelly&quot;</tt></p><p>If you decompose the regular expression you get:<font SIZE="2"></p></font><table BORDER="1" CELLSPACING="1" CELLPADDING="7" WIDTH="100%">  <tr>    <td WIDTH="77" VALIGN="TOP"><font face="Courier"><tt>^</tt></font></td>    <td WIDTH="509" VALIGN="TOP">Beginning of line anchor.</td>  </tr>  <tr>    <td WIDTH="77" VALIGN="TOP"><font face="Courier"><tt>[\t ]*</tt></font></td>    <td WIDTH="509" VALIGN="TOP">Any amount (that is zero or more characters) of tabs or    spaces.</td>  </tr>  <tr>    <td WIDTH="77" VALIGN="TOP"><font face="Courier"><tt>(.*)</tt></font></td>    <td WIDTH="509" VALIGN="TOP">Field 1: A tagged expression matching any string of    characters &#150; this will be the longest string that will still allow the rest of the    pattern to match.</td>  </tr>  <tr>    <td WIDTH="77" VALIGN="TOP"><font face="Courier"><tt>[\t ]*</tt></font></td>    <td WIDTH="509" VALIGN="TOP">Any amount of tabs or spaces.</td>  </tr>  <tr>    <td WIDTH="77" VALIGN="TOP"><font face="Courier"><tt>\\(</tt></font></td>    <td WIDTH="509" VALIGN="TOP">An escaped open parenthesis. The double slash is a C/C++    convention since this is the escape character and we want a literal slash to be passed    through to the regular expression code. If the user were typing this sort of thing into    your program they would only enter one slash. We escape the parenthesis so that it    doesn&#146;t get interpreted as a regular expression special character.</td>  </tr>  <tr>    <td WIDTH="77" VALIGN="TOP"><font face="Courier"><tt>(.*)</tt></font></td>    <td WIDTH="509" VALIGN="TOP">Field 2: A tagged expression matching any string of    characters.</td>  </tr>  <tr>    <td WIDTH="77" VALIGN="TOP"><font face="Courier"><tt>\\)</tt></font></td>    <td WIDTH="509" VALIGN="TOP">An escaped closing parenthesis.</td>  </tr></table><font SIZE="2"><p></font>BTW: the phrase <i>tagged regular expression</i> refers to any part of theregular expression that is, because it was surrounded by parenthesis, accessible after amatch has been made as a separate substring.&nbsp; See <ahref="#Regular Expression Syntax">here</a> for more information about Regular Expressionsyntax.</p><p>In English, we are looking for two fields. The first will be all characters from thestart of the line through to the second field (without any surrounding white space), andthe second will be all characters within parenthesis following the first field.</p><font FACE="Arial" SIZE="4"><b><a name="The Class"><p>The Class</a></b></font> </p><p>The library itself comes as two source files, Regexp.cpp and Regexp.h. The headerdefines the <tt>Regexp</tt> class with the following members:</p><p><strong><tt>Regexp::NSUBEXP </tt></strong></p><blockquote>  <p>A constant defining how many subexpressions that the library will support (usually 10),  attempting to use a regular expression with more than this number will generate an error.</p></blockquote><p><strong><tt>Regexp::Regexp() </tt></strong></p><blockquote>  <p>A boring constructor, this must be initialized by assignment before anything useful can  be done with it.</p></blockquote><p><strong><tt>Regexp::Regexp( TCHAR * exp, BOOL iCase = 0 ) </tt></strong></p><blockquote>  <p><tt>exp</tt> : </p></blockquote><blockquote>  <p>The regular expression itself, this format of which is defined later. The success or  failure of the compilation can be discovered by using either <tt>GetErrorString()</tt> or <tt>CompiledOK()</tt>.</p></blockquote><blockquote>  <p><tt>iCase</tt>:</p></blockquote><blockquote>  <p>If <tt>TRUE</tt> the regular expression is compiled so that differences in case are  ignored when matching.</p></blockquote><p><strong><tt>Regexp::Regexp( const Regexp &amp;r ) </tt></strong></p><blockquote>  <p>Construct a new regular expression taking the compiled form from another <tt>Regexp</tt>.  </p></blockquote><p><strong><tt>const Regexp::Regexp &amp; operator=( const Regexp &amp; r );</tt></strong></p><blockquote>  <p>Assign <tt>Regexp r</tt> to the current object.</p></blockquote><p><strong><tt>bool Regexp::Match( const TCHAR * s ); </tt></strong></p><blockquote>  <p>Examine the <tt>TCHAR</tt> array s with this regular expression, returning true if  there is a match. This match updates the state of this Regexp object so that the  substrings of the match can be obtained. The 0th substring is the substring of string that  matched the whole regular expression. The others are those substrings that matched  parenthesized expressions within the regular expression, with parenthesized expressions  numbered in left-to-right order of their opening parentheses. If a parenthesized  expression does not participate in the match at all, its length is 0. It is an error if  this <tt>Regexp</tt> has not been successfully initialized.</p></blockquote><p><strong><tt>int Regexp::SubStrings() const; </tt></strong></p><blockquote>  <p>Return the number of substrings found after a successful <tt>Match()</tt>.</p></blockquote><p><strong><tt>const CString Regexp::operator[]( unsigned int i ) const; </tt></strong></p><blockquote>  <p>Return the <tt>i</tt>th matched substring after a successful <tt>Match()</tt>.</p></blockquote><p><strong><tt>int Regexp::SubStart( unsigned int i ) const; </tt></strong></p><blockquote>  <p>Return the starting offset of the <tt>i</tt>th matched substring from the beginning of  the <tt>TCHAR </tt>array used in <tt>Match()</tt>.</p></blockquote><p><strong><tt>int Regexp::SubLength( unsigned int i ) const; </tt></strong></p><blockquote>  <p>Return the length of the <tt>i</tt>th matched substring</p></blockquote><blockquote>  <p>Using the same example Regexp as before:</p>  <pre><tt>Regexp re( &quot;^[\t ]*(.*)[\t ]*\\((.*)\\)&quot; );CString str( &quot;wyrdrune.com!kelly (Kelly)\n&quot; );if ( re.Match( str ) &amp;&amp; re.SubStrings() == 2 )

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产视频不卡一区| 不卡免费追剧大全电视剧网站| 欧美国产激情一区二区三区蜜月 | 久久久五月婷婷| 88在线观看91蜜桃国自产| 色老汉一区二区三区| 99久久夜色精品国产网站| 成人精品免费网站| 91最新地址在线播放| 91视频免费看| 欧美日韩国产在线观看| 欧美日韩精品久久久| 欧美精品久久99久久在免费线 | 日韩av在线播放中文字幕| 夜夜嗨av一区二区三区四季av| 亚洲精品国产高清久久伦理二区| 一区二区在线观看免费视频播放| 亚洲综合免费观看高清在线观看| 亚洲国产欧美一区二区三区丁香婷| 洋洋成人永久网站入口| 亚洲成国产人片在线观看| 五月婷婷综合在线| 久久91精品国产91久久小草| 国产乱码精品一区二区三区av| 国产成人啪免费观看软件| av在线播放一区二区三区| 色一情一伦一子一伦一区| 欧美精品第1页| 久久久精品黄色| 一区二区三区影院| 日本成人在线不卡视频| 国产夫妻精品视频| 色哦色哦哦色天天综合| 欧美精品在线观看播放| 国产亚洲美州欧州综合国 | 欧美日韩精品一区二区天天拍小说 | 香蕉加勒比综合久久| 美女视频一区二区| 成人的网站免费观看| 884aa四虎影成人精品一区| 久久久精品影视| 天天综合日日夜夜精品| 国产成人h网站| 欧美日韩一级片网站| 久久综合999| 亚洲午夜免费福利视频| 国产乱子伦视频一区二区三区| 色八戒一区二区三区| 久久亚洲捆绑美女| 亚洲国产中文字幕在线视频综合 | 综合激情成人伊人| 九色|91porny| 欧美在线观看你懂的| 国产亚洲精品aa午夜观看| 五月激情丁香一区二区三区| 成人网男人的天堂| 欧美va在线播放| 日韩中文字幕1| 在线欧美一区二区| 国产精品视频一二| 国内精品不卡在线| 91精品麻豆日日躁夜夜躁| 一区二区三区在线免费视频| 成人免费高清在线| 久久婷婷国产综合精品青草| 午夜久久福利影院| 91国产成人在线| 日韩毛片精品高清免费| av综合在线播放| 最新国产精品久久精品| 成人一道本在线| 中文字幕第一区第二区| 国产精品69久久久久水密桃| 精品国一区二区三区| 日本不卡视频在线观看| 欧美日本在线视频| 亚洲成av人片一区二区| 欧美日韩一区高清| 婷婷丁香激情综合| 欧美一区二区高清| 久久国产剧场电影| 2023国产一二三区日本精品2022| 麻豆一区二区三| 精品伦理精品一区| 国产伦精品一区二区三区视频青涩| 精品美女在线播放| 国产成人自拍高清视频在线免费播放| 欧美大片在线观看| 国产成人av电影免费在线观看| 国产日韩三级在线| 91在线一区二区三区| 亚洲一区二区三区美女| 欧美丰满少妇xxxxx高潮对白| 日韩成人免费在线| 久久免费电影网| www.欧美日韩国产在线| 亚洲人成人一区二区在线观看| 色综合天天视频在线观看| 亚洲成在线观看| 日韩免费观看高清完整版在线观看| 久久99国产精品成人| 中文字幕在线观看一区| 在线看一区二区| 乱一区二区av| 中文字幕在线观看不卡| 欧美日韩在线播放三区四区| 久久99国内精品| 亚洲欧美综合另类在线卡通| 欧美日韩一区精品| 国产精品99久久久| 午夜视频在线观看一区二区三区 | 不卡视频在线观看| 亚洲一区二区视频在线观看| 精品久久久久久久久久久久久久久| 成人精品视频一区二区三区尤物| 亚洲午夜精品在线| 久久精子c满五个校花| 日本精品视频一区二区| 久久97超碰国产精品超碰| 一区二区三区在线视频免费观看| 精品久久久久久亚洲综合网 | 亚洲成av人片一区二区三区| 久久久美女毛片| 884aa四虎影成人精品一区| 成人黄色av电影| 久久99久久久欧美国产| 亚洲一区二区中文在线| 国产日韩欧美激情| 91精品久久久久久久久99蜜臂| 91浏览器在线视频| 国产成人在线网站| 狂野欧美性猛交blacked| 亚洲激情综合网| 中文字幕久久午夜不卡| 精品国产三级a在线观看| 欧美日韩亚洲综合一区| 91在线国产观看| 国产91高潮流白浆在线麻豆| 久久精品国产免费看久久精品| 亚洲一区在线看| 亚洲人一二三区| 综合网在线视频| 日韩美女视频一区| 国产精品久久久久久久久免费丝袜| 欧美成人一区二区三区片免费 | 伊人开心综合网| 亚洲欧洲制服丝袜| 日本一区二区久久| 久久久91精品国产一区二区精品 | 91麻豆国产自产在线观看| 国产剧情一区在线| 国内精品免费**视频| 国内一区二区在线| 久久97超碰色| 国产乱一区二区| 国产精品一区久久久久| 狠狠色丁香久久婷婷综| 日精品一区二区三区| 日韩主播视频在线| 欧美96一区二区免费视频| 亚洲成年人网站在线观看| 偷拍亚洲欧洲综合| 免费高清成人在线| 加勒比av一区二区| 国产精品一品二品| 国产suv精品一区二区883| 国产成人av电影在线| 成年人国产精品| 91成人在线免费观看| 欧美日韩成人一区| 欧美午夜精品免费| 欧美日韩精品欧美日韩精品一综合| 欧美亚洲一区二区在线| 欧美理论电影在线| 日韩美一区二区三区| 国产亚洲欧洲997久久综合 | 日本韩国一区二区三区视频| 色婷婷av一区二区三区大白胸| 欧美性xxxxxx少妇| 日韩欧美亚洲一区二区| 欧美激情在线免费观看| 亚洲精品国产视频| 免费在线观看一区二区三区| 国产成人一区在线| 色婷婷久久久久swag精品 | 色综合 综合色| 制服丝袜中文字幕一区| 国产日韩精品视频一区| 亚洲在线一区二区三区| 久久黄色级2电影| 99国产精品久| 欧美一级专区免费大片| 国产精品久久三| 欧美a一区二区| 色综合久久天天| 精品久久人人做人人爰| 亚洲欧洲精品一区二区三区不卡| 午夜欧美视频在线观看| 国产成人综合在线观看| 欧美日韩视频第一区|