⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 re.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 2 页
字号:
.IX Subsection "'Debug' mode"Similarly \f(CW\*(C`use re \*(AqDebug\*(Aq\*(C'\fR produces debugging output, the differencebeing that it allows the fine tuning of what debugging output will beemitted. Options are divided into three groups, those related tocompilation, those related to execution and those related to specialpurposes. The options are as follows:.IP "Compile related options" 4.IX Item "Compile related options".RS 4.PD 0.IP "\s-1COMPILE\s0" 4.IX Item "COMPILE".PDTurns on all compile related debug options..IP "\s-1PARSE\s0" 4.IX Item "PARSE"Turns on debug output related to the process of parsing the pattern..IP "\s-1OPTIMISE\s0" 4.IX Item "OPTIMISE"Enables output related to the optimisation phase of compilation..IP "\s-1TRIEC\s0" 4.IX Item "TRIEC"Detailed info about trie compilation..IP "\s-1DUMP\s0" 4.IX Item "DUMP"Dump the final program out after it is compiled and optimised..RE.RS 4.RE.IP "Execute related options" 4.IX Item "Execute related options".RS 4.PD 0.IP "\s-1EXECUTE\s0" 4.IX Item "EXECUTE".PDTurns on all execute related debug options..IP "\s-1MATCH\s0" 4.IX Item "MATCH"Turns on debugging of the main matching loop..IP "\s-1TRIEE\s0" 4.IX Item "TRIEE"Extra debugging of how tries execute..IP "\s-1INTUIT\s0" 4.IX Item "INTUIT"Enable debugging of start point optimisations..RE.RS 4.RE.IP "Extra debugging options" 4.IX Item "Extra debugging options".RS 4.PD 0.IP "\s-1EXTRA\s0" 4.IX Item "EXTRA".PDTurns on all \*(L"extra\*(R" debugging options..IP "\s-1BUFFERS\s0" 4.IX Item "BUFFERS"Enable debugging the capture buffer storage during match. Warning,this can potentially produce extremely large output..IP "\s-1TRIEM\s0" 4.IX Item "TRIEM"Enable enhanced \s-1TRIE\s0 debugging. Enhances both \s-1TRIEE\s0and \s-1TRIEC\s0..IP "\s-1STATE\s0" 4.IX Item "STATE"Enable debugging of states in the engine..IP "\s-1STACK\s0" 4.IX Item "STACK"Enable debugging of the recursion stack in the engine. Enablingor disabling this option automatically does the same for debuggingstates as well. This output from this can be quite large..IP "\s-1OPTIMISEM\s0" 4.IX Item "OPTIMISEM"Enable enhanced optimisation debugging and start point optimisations.Probably not useful except when debugging the regex engine itself..IP "\s-1OFFSETS\s0" 4.IX Item "OFFSETS"Dump offset information. This can be used to see how regops correlateto the pattern. Output format is.Sp.Vb 1\&   NODENUM:POSITION[LENGTH].Ve.SpWhere 1 is the position of the first char in the string. Note that positioncan be 0, or larger than the actual length of the pattern, likewise lengthcan be zero..IP "\s-1OFFSETSDBG\s0" 4.IX Item "OFFSETSDBG"Enable debugging of offsets information. This emits copiousamounts of trace information and doesn't mesh well with otherdebug options..SpAlmost definitely only useful to people hackingon the offsets part of the debug engine..RE.RS 4.RE.IP "Other useful flags" 4.IX Item "Other useful flags"These are useful shortcuts to save on the typing..RS 4.IP "\s-1ALL\s0" 4.IX Item "ALL"Enable all options at once except \s-1OFFSETS\s0, \s-1OFFSETSDBG\s0 and \s-1BUFFERS\s0.IP "All" 4.IX Item "All"Enable \s-1DUMP\s0 and all execute options. Equivalent to:.Sp.Vb 1\&  use re \*(Aqdebug\*(Aq;.Ve.IP "\s-1MORE\s0" 4.IX Item "MORE".PD 0.IP "More" 4.IX Item "More".PDEnable \s-1TRIEM\s0 and all execute compile and execute options..RE.RS 4.RE.PPAs of 5.9.5 the directive \f(CW\*(C`use re \*(Aqdebug\*(Aq\*(C'\fR and its equivalents arelexically scoped, as the other directives are.  However they have bothcompile-time and run-time effects..Sh "Exportable Functions".IX Subsection "Exportable Functions"As of perl 5.9.5 're' debug contains a number of utility functions thatmay be optionally exported into the caller's namespace. They are listedbelow..IP "is_regexp($ref)" 4.IX Item "is_regexp($ref)"Returns true if the argument is a compiled regular expression as returnedby \f(CW\*(C`qr//\*(C'\fR, false if it is not..SpThis function will not be confused by overloading or blessing. Ininternals terms, this extracts the regexp pointer out of thePERL_MAGIC_qr structure so it it cannot be fooled..IP "regexp_pattern($ref)" 4.IX Item "regexp_pattern($ref)"If the argument is a compiled regular expression as returned by \f(CW\*(C`qr//\*(C'\fR,then this function returns the pattern..SpIn list context it returns a two element list, the first elementcontaining the pattern and the second containing the modifiers used whenthe pattern was compiled..Sp.Vb 1\&  my ($pat, $mods) = regexp_pattern($ref);.Ve.SpIn scalar context it returns the same as perl would when strigifying a raw\&\f(CW\*(C`qr//\*(C'\fR with the same pattern inside.  If the argument is not a compiledreference then this routine returns false but defined in scalar context,and the empty list in list context. Thus the following.Sp.Vb 1\&    if (regexp_pattern($ref) eq \*(Aq(?i\-xsm:foo)\*(Aq).Ve.Spwill be warning free regardless of what \f(CW$ref\fR actually is..SpLike \f(CW\*(C`is_regexp\*(C'\fR this function will not be confused by overloadingor blessing of the object..IP "regmust($ref)" 4.IX Item "regmust($ref)"If the argument is a compiled regular expression as returned by \f(CW\*(C`qr//\*(C'\fR,then this function returns what the optimiser consiers to be the longestanchored fixed string and longest floating fixed string in the pattern..SpA \fIfixed string\fR is defined as being a substring that must appear for thepattern to match. An \fIanchored fixed string\fR is a fixed string that mustappear at a particular offset from the beginning of the match. A \fIfloatingfixed string\fR is defined as a fixed string that can appear at any point ina range of positions relative to the start of the match. For example,.Sp.Vb 3\&    my $qr = qr/here .* there/x;\&    my ($anchored, $floating) = regmust($qr);\&    print "anchored:\*(Aq$anchored\*(Aq\enfloating:\*(Aq$floating\*(Aq\en";.Ve.Spresults in.Sp.Vb 2\&    anchored:\*(Aqhere\*(Aq\&    floating:\*(Aqthere\*(Aq.Ve.SpBecause the \f(CW\*(C`here\*(C'\fR is before the \f(CW\*(C`.*\*(C'\fR in the pattern, its positioncan be determined exactly. That's not true, however, for the \f(CW\*(C`there\*(C'\fR;it could appear at any point after where the anchored string appeared.Perl uses both for its optimisations, prefering the longer, or, if they areequal, the floating..Sp\&\fB\s-1NOTE:\s0\fR This may not necessarily be the definitive longest anchored andfloating string. This will be what the optimiser of the Perl that youare using thinks is the longest. If you believe that the result is wrongplease report it via the perlbug utility..IP "regname($name,$all)" 4.IX Item "regname($name,$all)"Returns the contents of a named buffer of the last successful match. If\&\f(CW$all\fR is true, then returns an array ref containing one entry per buffer,otherwise returns the first defined buffer..IP "regnames($all)" 4.IX Item "regnames($all)"Returns a list of all of the named buffers defined in the last successfulmatch. If \f(CW$all\fR is true, then it returns all names defined, if not it returnsonly names which were involved in the match..IP "\fIregnames_count()\fR" 4.IX Item "regnames_count()"Returns the number of distinct names defined in the pattern usedfor the last successful match..Sp\&\fBNote:\fR this result is always the actual number of distinctnamed buffers defined, it may not actually match that which isreturned by \f(CW\*(C`regnames()\*(C'\fR and related routines when those routineshave not been called with the \f(CW$all\fR parameter set..SH "SEE ALSO".IX Header "SEE ALSO"\&\*(L"Pragmatic Modules\*(R" in perlmodlib.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -