91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 17KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2024-02-03
  • 語言: C/C++
  • 標簽: c??regex??

資源簡介

正則表達式是一個很強的工具,可以在你的軟件中增強查找、替換、匹配等功能。附件中封裝了Henry Spencer的regex library源碼,有說明和范例,純C可移值,簡單易用。

資源截圖

代碼片段和文件信息

/**
?*??@file?JRegex.c
?*
?*??@brief??Regular?expression?functions
?*
?*??Original?code?by?Henry?Spencer
?*??Henry?Spencer‘s?regex?library
?*??ftp://ftp.zoo.toronto.edu/pub/bookregexp.{tar|shar}
?*??or?http://www.arglist.com/regex/files/regexp.old.tar.Z
?*
?*??Wrapped?by?JoStudio
?*
?*
?*/


//=================Start?of?wapped?Henry?Spencer‘s?regex?library?==============
//??Functions?written?by?Henry?Spencer
/*
?*?regmagic.h??regcomp?and?regexec?are?include
?*/
#include?
#include?
#include?
#include?
///#include?
//====?start?of?“regex.h“?=======
/*
?*?Definitions?etc.?for?regexp(3)?routines.
?*
?*?Caveat:??this?is?V8?regexp(3)?[actually?a?reimplementation?thereof]
?*?not?the?System?V?one.
?*/
#define?NSUBEXP??10
typedef?struct?regexp?{
char?*startp[NSUBEXP];
char?*endp[NSUBEXP];
char?regstart; /*?Internal?use?only.?*/
char?reganch; /*?Internal?use?only.?*/
char?*regmust; /*?Internal?use?only.?*/
int?regmlen; /*?Internal?use?only.?*/
char?program[1]; /*?Unwarranted?chumminess?with?compiler.?*/
}?regexp;

regexp?*regcomp(const?char?*re);
int?regexec(regexp?*rp?const?char?*s);
void?regsub(const?regexp?*rp?const?char?*src?char?*dst);
void?regerror(char?*message);
//====?end?of?“regex.h“?=======

///#include?
//====?start?of?“regmagic.h“?=======
/*
?*?The?first?byte?of?the?regexp?internal?“program“?is?actually?this?magic
?*?number;?the?start?node?begins?in?the?second?byte.
?*/
#define MAGIC 0234
//====?end?of?“regmagic.h“?=======

//====?start?of?“regexp.c“?=======
/*
?*?The?“internal?use?only“?fields?in?regexp.h?are?present?to?pass?info?from
?*?compile?to?execute?that?permits?the?execute?phase?to?run?lots?faster?on
?*?simple?cases.??They?are:
?*
?*?regstart char?that?must?begin?a?match;?‘\0‘?if?none?obvious
?*?reganch is?the?match?anchored?(at?beginning-of-line?only)?
?*?regmust string?(pointer?into?program)?that?match?must?include?or?NULL
?*?regmlen length?of?regmust?string
?*
?*?Regstart?and?reganch?permit?very?fast?decisions?on?suitable?starting?points
?*?for?a?match?cutting?down?the?work?a?lot.??Regmust?permits?fast?rejection
?*?of?lines?that?cannot?possibly?match.??The?regmust?tests?are?costly?enough
?*?that?regcomp()?supplies?a?regmust?only?if?the?r.e.?contains?something
?*?potentially?expensive?(at?present?the?only?such?thing?detected?is?*?or?+
?*?at?the?start?of?the?r.e.?which?can?involve?a?lot?of?backup).??Regmlen?is
?*?supplied?because?the?test?in?regexec()?needs?it?and?regcomp()?is?computing
?*?it?anyway.
?*/

/*
?*?Structure?for?regexp?“program“.??This?is?essentially?a?linear?encoding
?*?of?a?nondeterministic?finite-state?machine?(aka?syntax?charts?or
?*?“railroad?normal?form“?in?parsing?technology).??Each?node?is?an?opcode
?*?plus?a?“next“?pointer?possibly?plus?an?operand.??“Next“?pointers?of
?*?all?nodes?except?BRANCH?implement?concatenation;?a?“next“?pointer?with
?*?a?BRANCH?on?both?ends?of?it?is?connecting?two?alternatives.??(Here?we
?*?have?one?of?the?su

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????40610??2011-06-26?13:59??JRegex.c

?????文件???????4420??2011-06-26?13:59??JRegex.h

?????文件???????3665??2011-06-26?14:30??test.c

?????文件???????6853??2011-06-26?14:37??002?正則表達式(regex)及C語言實現.txt

-----------?---------??----------?-----??----

????????????????55548????????????????????4


評論

共有 條評論