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

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

?? csregex.pas

?? Delphi script parser
?? PAS
?? 第 1 頁 / 共 5 頁
字號:
       <p>A regular expression (or RE) specifies a set of strings that matches
       it;
       The functions in this component let you check if a particular string
       matches a given regular expression (or if a given regular expression
       matches a particular string, which comes down to the same thing).</p>

       <p>Regular expressions can be concatenated to form new regular
       expressions;
       If A and B are both regular expressions, then AB is also an regular
       expression. If a string p matches A and another string q matches B, the
       string pq will match AB. Thus, complex expressions can easily be
       constructed from simpler ones like the primitives described here.
       For details of the theory and implementation of regular expressions,
       consult almost any textbook about compiler construction.</p>

       <p>A brief explanation of the format of regular expressions follows.</p>

       <p>Regular expressions can contain both special and ordinary characters.
       Ordinary characters, like 'A', 'a', or '0', are the simplest regular
       expressions; they simply match themselves. You can concatenate ordinary
       characters, so 'last' matches the characters 'last'. (In the rest of this
       section, we'll write RE's in this special font, usually without quotes,
       and strings to be matched 'in single quotes'.)</p>

       <p>Special characters either stand for classes of ordinary characters, or
       affect how the regular expressions around them are interpreted.</p>

       <p>The special characters are:</p>

       <p><b>.</b> (Dot.) Matches any character except a newline.</p>
       <p><b>^</b> (Caret.) Matches the start of the string.</p>
       <p><b>$</b> Matches the end of the string. foo matches both 'foo' and
       'foobar', while the regular expression 'foo$' matches only 'foo'.</p>
       <p><b>*</b> Causes the resulting RE to match 0 or more repetitions of the
       preceding RE. ab* will match 'a', 'ab', or 'a' followed by any number of
       'b's.</p>
       <p><b>+</b> Causes the resulting RE to match 1 or more repetitions of the
       preceding RE. ab+ will match 'a' followed by any non-zero number of 'b's;
       <br>it will not match just 'a'.</p>
       <p><b>?</b> Causes the resulting RE to match 0 or 1 repetitions of the
       preceding RE. ab? will match either 'a' or 'ab'.</p>

       <p><b>\</b> Either escapes special characters (permitting you to match
       characters like '*?+&$'), or signals a special sequence; special
       sequences are discussed below.</p>

       <p><b>[ ]</b> Used to indicate a set of characters. Characters can be
       listed individually, or a range is indicated by giving two characters and
       separating them by a '-'. Special characters are not active inside sets.
       For example, [akm$] will match any of the characters 'a', 'k', 'm', or
       '$'; [a-z] will match any lowercase letter. If you want to include a ]
       inside a set, it must be the first character of the set;
       To include a -, place it as the first or last character.</p>

       <p>Characters not within a range can be matched by including a ^ as the
       first character of the set; ^ elsewhere will simply match the '^'
       character.</p>

       <p>The standard style is EGrep compatible, which means that (, ), and |
       doesn't have to be qouted. If you change the style setting, take in
       account the differences.</p>
       <p>See alse <See Class="TmkreExpr" property="SyntaxStyles"></p>
       <p>The special sequences consist of '\' and a character from the list
       below. If the ordinary character is not on the list, then the resulting
       RE will match the second character. For example, \$ matches the character
       '$'.</p>

       <p><b>|</b> A|B, where A and B can be arbitrary REs, creates a regular
       expression that will match either A or B. This can be used inside groups
       (see below) as well.</p>
       <p><b>( )</b> Indicates the start and end of a group; the contents of a
       group can be matched later in the string with the \[1-9] special
       sequence, described next.</p>
       <p><b>\1</b> .. <b>\9</b> Matches the contents of the group of the same
       number. For example, (.+) \1 matches 'the the' or '55 55', but not 'the
       end' (note the space after the group). This special sequence can only be
       used to match one of the first 9 groups; groups with higher numbers can
       be matched using the \v sequence.</p>
       <p><b>\b</b> Matches the empty string, but only at the beginning or end
       of a word. A word is defined as a sequence of alphanumeric characters, so
       the end of a word is indicated by whitespace or a non-alphanumeric
       character.</p>
       <p><b>\B</b> Matches the empty string, but when it is not at the
       beginning or end of a word.</p>
       <p><b>\v</b> Must be followed by a two digit decimal number, and matches
       the contents of the group of the same number. The group number must be
       between 1 and 99, inclusive.</p>
       <p><b>\d</b> Matches any digit; this is equivalent to the set [0-9].</p>
       <p><b>\D</b> Matches any non-digit; this is equivalent to the set [^0-9].
       </p>
       <p><b>\w</b> Matches any alphanumeric character; this is equivalent to
       the set [a-zA-Z0-9].</p>
       <p><b>\W</b> Matches any non-alphanumeric character; this is equivalent
       to the set [^a-zA-Z0-9].</p>
       <p><b>\<</b> Matches the empty string, but only at the beginning of a
       word. A word is defined as a sequence of alphanumeric characters, so the
       end of a word is indicated by whitespace or a non-alphanumeric character.
       </p>
       <p><b>\></b> Matches the empty string, but only at the end of a word.</p>
       <p><b>\\</b> (2 backslashes) Matches a literal backslash.</p>
        <p><b>\`</b> Like ^, this only matches at the start of the string.</p>
       <p><b>\'</b> Like $, this only matches at the end of the string.</p> }
    property Pattern: string read FPattern write Setpattern;

    {: Syntaxt style to use.
       <p>Following Syntax rules are defined:</p>
       <UL>
         <LI><b>mkre_No_Bk_Parens</b> no quoting for parentheses  ( )
         <LI><b>mkre_No_Bk_Vbar</b> no quoting for vertical bar |
         <LI><b>mkre_Bk_Plus_Qm</b> quoting needed for + and ?
         <LI><b>mkre_Tight_Vbar</b> | binds tighter than ^ and $
         <LI><b>mkre_Newline_Or</b> treat newline (in expression) as or
         <LI><b>mkre_Context_Indep_Ops</b> ^$?*+ are special in all contexts
         <LI><b>mkre_Ansi_Hex</b> ansi sequences (\n etc) and \xhh
         <LI><b>mkre_No_Gnu_Extensions</b> no gnu extensions
         <LI><b>mkre_HighCharsWhitespace</b> all characters above 127 are whitespaces
       </UL>
       <p>Common styles:</p>
       <UL>
         <LI><b>WK</b> mkre_No_Bk_Parens, mkre_No_Bk_Vbar and mkre_Context_Indep_Ops
         <LI><b>EGREP</b> mkre_No_Bk_Parens, mkre_No_Bk_Vbar, mkre_Context_Indep_Ops and
                 mkre_Newline_Or
         <LI><b>GREP</b> mkre_Bk_Plus_Qm and mkre_Newline_Or
         <LI><b>EMACS</b> none
       </UL>
       <p>Default setting when created:</p>
       <UL>
         <LI><b>EGREP</b> mkre_No_Bk_Parens, mkre_No_Bk_Vbar,
         mkre_Context_Indep_Ops and mkre_Newline_Or
       </UL>}
    property SyntaxStyles: TmkreSyntaxStyles read FSyntaxStyles write SetSyntaxStyles;

    {: This string will be matched by the pattern.

    <p>Matching can be started by:</p>
    <OL>
      <LI>Reading Matches
      <LI>calling the DoMatch method
      <LI>Setting Active to True
    </OL>
    When adding a text file to this property, be aware that the Regular
    expressions works on Unix text files, that means that lines are separated by
    a LF and not by Cr / LF. It's because of that that it is nessesary to
    eliminate the CR from the file. For that purpose the function
    mkConvertDos2Ux is added.

    <p>See also: <See Class="TmkreExpr" Property ="Pattern">,
    <See Class="TmkreExpr" Property ="Matches">,
    <See Class="TmkreExpr" Method ="DoMatch">,
    <See Class="TmkreExpr" Property ="Active">,
    <See Routine="mkConvertDos2Ux"></p>}
    property Str: string read FStr write SetStr;

    {: This event is called everytime when an match is found on a string.
    <p></p>
    @Param Sender Is the TmkreRegexpr component that caused the event
    @Param str The match that was found
    @Param pos The start position of the match in Str
    @Param ret The end position of the match in Str
    @Param re_registers The groups that were found }
    property OnMatch: TOnMatchEvent read FOnMatch write FOnMatch;

    {: This event is triggered after the whole string is searched for matches,
    and before the Thread for matching is destroyed. }
    property OnEndMatch: TNotifyEvent read FOnEndMatch write FOnEndMatch;

    {:This event is called when a match is found for the search pattern.
    <p></p>
    @param Sender The TmkRegexpr component that caused the event
    @param str The match that was found
    @param pos The start position of the match in Str
    @param re_registers The groups that were found }
    property OnSearch: TOnSearchEvent read FOnSearch write FOnSearch;

    {: This event is called before any match is done. }
    property OnStartMatch: TNotifyEvent read FOnStartMatch write FOnStartMatch;
  end;

procedure csRegex_Install(ProcManager: PProcedureManager);
{This will install:

Function ReMatch (Str, Pattrn : String) : Boolean;
Function ReSearch(Str, Pattrn : String) : Integer;
}

implementation

const
  STACK_PAGE_SIZE = 256;
  NUM_REGISTERS = 256;
  NUM_LEVELS = 5;
  MAX_NESTING = 100;

{  The stack implementation is taken from an idea by Andrew Kuchling.
 * It's a doubly linked list of arrays. The advantages of this over a
 * simple linked list are that the number of mallocs required are
 * reduced. It also makes it possible to statically allocate enough
 * space so that small patterns don't ever need to call malloc.
 *
 * The advantages over a single array is that is periodically
 * realloced when more space is needed is that we avoid ever copying
 * the stack. }


type
  Pitem_t = ^Titem_t;
{: item_t is the basic stack element.  Defined as a union of
   structures so that both registers, failure points, and counters can
   be pushed/popped from the stack.  There's nothing built into the
   item to keep track of whether a certain stack item is a register, a
   failure point, or a counter. }
  Titem_t = record
    reg_num: integer;
    reg_level: integer;
    reg_start: PChar;
    reg_end: PChar;
    fail_count: integer;
    fail_level: integer;
    fail_phantom: integer;
    fail_code: PChar;
    fail_text: PChar;

   //MK: union causes error
{  case integer of
    0: (reg_num: integer;
        reg_level: integer;
        reg_start: PChar;
        reg_end: PChar);
    1: (fail_count: integer;
        fail_level: integer;
        fail_phantom: integer;
        fail_code: PChar;
        fail_text: PChar); }
  end;

  Pitem_page_t = ^Titem_page_t;
{: A 'page' of stack items. }
  Titem_page_t = record
    items: array[0..NUM_REGISTERS] of Titem_t;
    prev: Pitem_page_t;
    next: Pitem_page_t;
  end;

{: Structure to encapsulate the stack. }
  Tstack = record
    index: integer;
    current: Pitem_page_t; // Pointer to the current page.
    first: Titem_page_t; // First page is statically allocated.
  end;

  Tmatch_state = record
{:  The number of registers that have been pushed onto the stack
    since the last failure point. }
    count: integer;

{:  The number of failure points on the stack.}
    level: integer;

{:  The number of failure points on the stack.}
    point: integer;

{:  Storage for the registers.  Each register consists of two
    pointers to characters.  So register N is represented as
    start[N] and end[N].  The pointers must be converted to
    offsets from the beginning of the string before returning the
    registers to the calling program. }
    _start: array[0..NUM_REGISTERS] of Pchar;
    _end: array[0..NUM_REGISTERS] of Pchar;

{:  Keeps track of whether a register has changed recently.}
    changed: array[0..NUM_REGISTERS] of integer;

{   Index into the curent page.  If index == 0 and you need
    to pop an item, move to the previous page and set index
    = STACK_PAGE_SIZE - 1.  Otherwise decrement index to
    push a page. If index == STACK_PAGE_SIZE and you need
    to push a page move to the next page and set index =
    0. If there is no new next page, allocate a new page
    and link it in. Otherwise, increment index to push a
    page.}
    stack: Tstack;
  end;

function rematchProc(ID: Pointer; Name: string; params: PVariableManager; Res: PCajVariant): Word; far;
var
  vPattern: PCajVariant;
  vString: PCajVariant;
  re: TcsReExpr;
  regs: Tmkre_registers;
begin
  rematchProc := ENoError;
  re := TcsReExpr.Create;
  try
    vString := GetVarLink(VM_Get(Params, 0));
    vPattern := GetVarLink(VM_Get(Params, 1));
    if Assigned(vString) and Assigned(vPattern) then begin
      re.Str := vString.Cv_Str;
      re.Pattern := vPattern.Cv_Str;
      Res^.cv_Bool := re.re_Match(1, @regs) > 0;
    end else
      Res^.cv_Bool := True;
  finally
    re.Free;
  end;
end;

function reSearchProc(ID: Pointer; Name: string; params: PVariableManager; Res: PCajVariant): Word; far;
var
  vPattern: PCajVariant;
  vString: PCajVariant;
  re: TcsReExpr;
begin
  reSearchProc := ENoError;
  re := TcsReExpr.Create;
  try
    vString := GetVarLink(VM_Get(Params, 0));
    vPattern := GetVarLink(VM_Get(Params, 1));
    if Assigned(vString) and Assigned(vPattern) then begin
      re.Str := vString.Cv_Str;
      re.Pattern := vPattern.Cv_Str;
      SetInteger(Res, re.DoSearch(1));
    end else
      SetInteger(Res, 0);
  finally
    re.Free;
  end;
end;

procedure csRegex_Install(ProcManager: PProcedureManager);
begin
{$IFDEF DELPHI}
  PM_Add(ProcManager, '14 REMATCH STRING 8 PATTERN 8', @rematchProc); //bool REMATCH (string string)
  PM_Add(ProcManager, '6 RESEARCH STRING 8 PATTERN 8', @reSearchProc); //integer RESEARCH (string string)
{$ELSE}
  PM_Add(ProcManager, '14 REMATCH STRING 8 PATTERN 8', rematchProc); //bool REMATCH (string string)
  PM_Add(ProcManager, '6 RESEARCH STRING 8 PATTERN 8', reSearchProc); //integer RESEARCH (string string)
{$ENDIF}
end;

{: Initializes the component.
   <P>Default the component is not active, and EGREP compatible, the fastmap will
   be used.</P>}

constructor TcsReExpr.Create;
begin
  inherited Create;
  FActive := False;
  FNoChange := False;
  FStyleChange := True;
  FMatches := TStringList.Create;
  SetSyntaxStyles([mkre_No_Bk_Parens, mkre_No_Bk_Vbar, mkre_Context_Indep_Ops,
    mkre_Newline_Or]);
  SetLength(regexp_t.fastmap, 256);
  regexp_t.translate := '';
  regexp_t.fastmap_accurate := False;
  regexp_t.can_be_null := #0;
  regexp_t.uses_registers := True;
  regexp_t.anchor := 0;
  FUseFastmap := True;
end;

{: Deinitialize the component. Memory and threads are freed. }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
97久久精品人人澡人人爽| 一区二区三区在线观看欧美| 日韩一区二区三区四区| 日韩视频免费观看高清在线视频| 91麻豆精品国产91| 欧美成人精品高清在线播放 | 7799精品视频| 久久综合九色综合久久久精品综合| 精品第一国产综合精品aⅴ| 久久嫩草精品久久久久| 中文字幕综合网| 日韩精品1区2区3区| 国产乱一区二区| 91麻豆免费视频| 91精品国产美女浴室洗澡无遮挡| 久久久影院官网| 亚洲综合在线视频| 国产精品自拍在线| 欧洲中文字幕精品| 欧美精品一区二区三区四区| 亚洲色图在线视频| 久久aⅴ国产欧美74aaa| 一本久久综合亚洲鲁鲁五月天| 欧美精品自拍偷拍| 中文字幕日韩精品一区| 久久99最新地址| 欧美人与禽zozo性伦| 欧美国产日韩在线观看| 久久国产三级精品| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 欧美一区二区在线不卡| 亚洲欧美经典视频| 国产+成+人+亚洲欧洲自线| 日韩一二在线观看| 亚洲大片一区二区三区| 91免费看`日韩一区二区| 久久久久亚洲蜜桃| 国内欧美视频一区二区| 91精品国产综合久久精品app| 亚洲免费观看在线观看| 成人av影院在线| 国产精品入口麻豆原神| 国产+成+人+亚洲欧洲自线| 精品免费99久久| 狠狠色丁香久久婷婷综合_中| 欧美一区二区成人6969| 老司机午夜精品| 久久久久久久精| 国产精品一区在线观看你懂的| 日韩精品一区二区三区视频播放| 美女一区二区视频| 日韩一区二区三区在线观看| 国产精品传媒视频| 视频一区在线播放| 91精品欧美综合在线观看最新| 日本在线不卡视频一二三区| 欧美电影免费观看高清完整版在线观看| 丝袜a∨在线一区二区三区不卡| 欧美一区欧美二区| www.欧美日韩| 日韩av电影免费观看高清完整版 | 国产精品午夜电影| 色婷婷久久一区二区三区麻豆| 五月天亚洲婷婷| 国产亚洲欧美色| 欧美日韩一本到| 国产高清不卡一区二区| 五月天激情综合网| 日韩毛片视频在线看| 国产不卡视频一区二区三区| 欧美一级在线观看| 韩国在线一区二区| 日韩一级大片在线观看| 亚洲成a天堂v人片| 欧美岛国在线观看| gogogo免费视频观看亚洲一| 亚洲精选视频在线| 日韩一级二级三级精品视频| 97久久人人超碰| 国产精品资源在线| 美女视频网站久久| 亚洲午夜成aⅴ人片| 国产欧美中文在线| 欧美一区二区视频网站| 91捆绑美女网站| 国产酒店精品激情| 日韩高清在线一区| 亚洲一区二区三区四区在线免费观看| 国产精品天美传媒| 一区二区免费视频| 国产精品久久久99| 精品福利在线导航| 欧美色倩网站大全免费| 国产成人精品影院| 国产一区视频导航| 麻豆国产精品视频| 蜜臀久久99精品久久久久宅男| 天堂成人免费av电影一区| 亚洲综合图片区| 亚洲综合一区二区精品导航| **性色生活片久久毛片| 国产午夜精品久久久久久久| 日韩精品一区二区在线| 精品日韩欧美一区二区| 欧美电视剧在线观看完整版| 久久免费偷拍视频| 亚洲欧洲av另类| 一区二区成人在线| 三级久久三级久久久| 亚洲成人黄色小说| 一区二区三国产精华液| 一区二区免费在线| 日韩av二区在线播放| 精品在线播放免费| 国产成人免费高清| 欧美日韩一二三| 亚洲精品一线二线三线| 亚洲私人黄色宅男| 视频一区欧美精品| 国产乱人伦偷精品视频不卡| av在线不卡观看免费观看| 成人国产视频在线观看| 在线看日韩精品电影| 91精品国产福利在线观看| 欧美国产日本韩| 日本欧美韩国一区三区| 国产成人免费在线| 欧美日韩在线三区| 久久在线观看免费| 亚洲一区二区偷拍精品| 色婷婷av一区二区三区gif| 日韩欧美国产精品一区| 亚洲美女区一区| 粉嫩av一区二区三区粉嫩 | 天堂久久一区二区三区| 国产美女主播视频一区| 欧美日韩1234| 曰韩精品一区二区| 成人性视频网站| 久久综合九色综合欧美亚洲| 亚洲高清视频在线| 97se亚洲国产综合自在线 | 91在线精品一区二区| 国产天堂亚洲国产碰碰| 国内精品写真在线观看| 欧美一区二区三区免费大片| 亚洲日本丝袜连裤袜办公室| 国产suv精品一区二区883| 欧美一区二区在线看| 午夜精品一区二区三区免费视频| 欧美三级韩国三级日本一级| 亚洲四区在线观看| 91丨九色丨黑人外教| 国产欧美日韩精品一区| 丁香婷婷综合色啪| 久久蜜桃一区二区| 精品在线亚洲视频| 久久久久久久久久久久久女国产乱| 免费观看在线综合| 欧美久久久久久久久中文字幕| 亚洲成人激情自拍| 欧美美女网站色| 久久99热国产| 国产精品沙发午睡系列990531| 国产伦精品一区二区三区免费迷| 91国产视频在线观看| 欧美国产视频在线| 99re这里只有精品6| 中文字幕一区二区三区色视频| 9久草视频在线视频精品| 亚洲欧洲中文日韩久久av乱码| 欧美无砖专区一中文字| 日韩国产高清在线| 久久日一线二线三线suv| 成人午夜伦理影院| 洋洋av久久久久久久一区| 久久综合色婷婷| 欧美午夜精品一区| 国产一区二区福利视频| 国产精品久久久久天堂| 欧美人xxxx| 成人国产一区二区三区精品| 日韩精品五月天| 亚洲欧洲av另类| 精品国产乱码久久久久久久久| 99久久精品国产麻豆演员表| 亚洲成人综合视频| 国产欧美日韩在线| 欧美日精品一区视频| av网站一区二区三区| 蜜臀精品一区二区三区在线观看 | 久久疯狂做爰流白浆xx| 中文字幕精品综合| 91精品国产一区二区三区蜜臀| 成人av电影在线观看| 免费欧美在线视频| 午夜一区二区三区视频| 亚洲日本成人在线观看| 国产欧美精品一区二区三区四区 | 在线播放日韩导航|