📄 regex-spencer-man.ps
字号:
1.581(places the NUL-terminated message into the b)4.081 F(uf)-.2 E1.581(fer pointed to by)-.25 F F1(errb)108 756 Q(uf)-.2 E F0 3.823(,l)1.96 G 1.323(imiting the length \(including the NUL\) to at most)-3.823F F1(errb)3.823 E(uf_size)-.2 E F0 3.823(bytes. If)3.823 F 1.323(the whole message)3.823 F -.1(wo)108 768 S(n').1 E 3.519<748c>-.18 G1.019(t, as much of it as will \214t before the terminating NUL is supplied.)-3.519 F 1.02(In an)6.019 F 3.52(yc)-.15 G 1.02(ase, the returned)-3.52F -.25(va)108 780 S 2.829(lue is the size of b).25 F(uf)-.2 E 2.829(fer needed to hold the whole message \(including terminating NUL\).)-.25 F(If)7.829 E 194.248(22)72 817.889 S 2.5(5S)-194.248 G(ept 1997)-2.5 E 0 Cg EP%%Page: 3 3%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Roman@0 SF 358.795(REGEX\(3\) REGEX\(3\))72 48 R/F1 10/Times-Italic@0 SF(errb)108 84 Q(uf_size)-.2 E F0(is 0,)2.5 E F1(errb)2.5 E(uf)-.2 E F0(is ignored b)2.5 E(ut the return v)-.2 E(alue is still correct.)-.25 E .358(If the)108 100.8 R F1(err)2.858 E(code)-.37 E F0(gi)2.858 E -.15(ve)-.25 G 2.858(nt).15 G(o)-2.858 E F1-.37(re)2.858 G -.1(ge)-.03 G(rr).1 E(or)-.45 E F0 .358(is \214rst ORed with REG_IT)2.858 F -.35(OA)-.18 G 2.859(,t).35 G .359(he `)-2.859 F(`message')-.74 E 2.859('t)-.74 G .359(hat results is the print-)-2.859 F .067(able name of the error code, e.g. `)108 112.8 R(`REG_NOMA)-.74 E(TCH')-1.11 E .067(', rather than an e)-.74 F .067(xplanation thereof.)-.15 F(If)5.067 E F1(err)2.567 E(code)-.37 E F0(is)2.567 E(REG_A)108 124.8 Q-.18(TO)-1.11 G .779(I, then).18 F F1(pr)3.279 E -.4(eg)-.37 G F0 .779(shall be non-NULL and the)3.679 F F1 -.37(re)3.28 G(_endp).37 E F0 .78(member of the structure it points to must)3.28 F .184(point to the pri\ntable name of an error code; in this case, the result in)108 136.8 R F1(errb)2.683 E(uf)-.2 E F0 .183(is the decimal digits of the)2.683 F1.229(numeric v)108 148.8 R 1.23(alue of the error code \(0 if the name is not recognized\).)-.25 F(REG_IT)6.23 E 1.93 -.35(OA a)-.18 H 1.23(nd REG_A).35 F -.18(TO)-1.11 G3.73(Ia).18 G(re)-3.73 E 1.282(intended primarily as deb)108 160.8 R1.282(ugging f)-.2 F 1.282(acilities; the)-.1 F 3.782(ya)-.15 G 1.282(re e)-3.782 F 1.282(xtensions, compatible with b)-.15 F 1.282(ut not speci\214ed by)-.2 F .703(POSIX 1003.2, and should be used with caution in softw)108 172.8 R .703(are intended to be portable to other systems.)-.1 F(Be w)108 184.8 Q(arned also that the)-.1 E 2.5(ya)-.15 G(re considered e)-2.5 E(xperimental and changes are possible.)-.15 E F1(Re)108 201.6 Q(gfr)-.4E(ee)-.37 E F0 .909(frees an)3.409 F 3.409(yd)-.15 G .909(ynamically-al\located storage associated with the compiled RE pointed to by)-3.409 FF1(pr)3.408 E -.4(eg)-.37 G F0(.).62 E 1.122(The remaining)108 213.6 RF1 -.37(re)3.622 G -.1(ge)-.03 G(x_t)-.1 E F0 1.122(is no longer a v)3.622 F 1.123(alid compiled RE and the ef)-.25 F 1.123(fect of supplying it to)-.25 F F1 -.37(re)3.623 G -.1(ge)-.03 G(xec)-.1E F0(or)3.623 E F1 -.37(re)108 225.6 S -.1(ge)-.03 G(rr).1 E(or)-.45 EF0(is unde\214ned.)2.5 E .814(None of these functions references global v)108 242.4 R .814(ariables e)-.25 F .813(xcept for tables of constants; all are safe for use)-.15 F(from multiple threads if the ar)108 254.4 Q(guments are safe.)-.18 E/F210.95/Times-Bold@0 SF(IMPLEMENT)72 271.2 Q -1.04(AT)-.986 G(ION CHOICES)1.04 E F0 .771(There are a number of decisions that 1003.2 lea)108 283.2R -.15(ve)-.2 G 3.272(su).15 G 3.272(pt)-3.272 G 3.272(ot)-3.272 G .772(he implementor)-3.272 F 3.272(,e)-.4 G .772(ither by e)-3.272 F .772(xplicitly saying)-.15 F -.74(``)108 295.2 S(unde\214ned').74 E 3.939('o)-.74 G 3.939(rb)-3.939 G 3.939(yv)-3.939 G 1.438(irtue of them being forbidden by the RE grammar)-3.939 F 6.438(.T)-.55G 1.438(his implementation treats)-6.438 F(them as follo)108 307.2 Q(ws.)-.25 E(See)108 324 Q F1 -.37(re)2.5 G -.1(ge)-.03 G(x)-.1 E F0(\(7\\) for a discussion of the de\214nition of case-independent matching.).53 E .491(There is no particular limit on the length of REs, e)108340.8 R .491(xcept insof)-.15 F .491(ar as memory is limited.)-.1 F .491(Memory usage)5.491 F .143(is approximately linear in RE size, and lar)108 352.8 R .142(gely insensiti)-.18 F .442 -.15(ve t)-.25 H 2.642(oR).15 G 2.642(Ec)-2.642 G(omple)-2.642 E(xity)-.15 E 2.642(,e)-.65 G .142(xcept for bounded repeti-)-2.792 F 2.5(tions. See)108 364.8 R -.1(BU)2.5 G(GS for one short RE using them that will run almost an).1 E 2.5(ys)-.15 G(ystem out of memory)-2.5 E(.)-.65 E 4.042(Ab)108 381.6 S1.542(ackslashed character other than one speci\214cally gi)-4.042 F-.15(ve)-.25 G 4.043(nam).15 G 1.543(agic meaning by 1003.2 \(such magic)-4.043 F(meanings occur only in obsolete [`)108 393.6 Q(`basic')-.74 E('] REs\) is tak)-.74 E(en as an ordinary character)-.1 E(.)-.55 E(An)108 410.4 Q 2.5(yu)-.15 G(nmatched [ is a REG_EBRA)-2.5 E(CK error)-.4 E(.)-.55 E(Equi)108 427.2 Q -.25(va)-.25 G .462(lence classes cannot be).25 F .462(gin or end brack)-.15 F(et-e)-.1 E .462(xpression ranges.)-.15 F .462(The endpoint of one range cannot)5.462 F(be)108 439.2 Q(gin another)-.15 E(.)-.55 E(RE_DUP_MAX, the limit on repetition counts\ in bounded repetitions, is 255.)108 456 Q 2.683(Ar)108 472.8 S .183(epetition operator \(?, *, +, or bounds\) cannot follo)-2.683 F 2.683(wa)-.25 G .183(nother repetition operator)-2.683 F 5.183(.A)-.55 G .183(repetition opera-)-2.5 F(tor cannot be)108 484.8 Q(gin an e)-.15 E(xpression or sube)-.15 E(xpression or follo)-.15 E 2.5(w`)-.25 G(^' or `|'.)-2.5 E .297(`|' cannot appear \214rst or last in a \(sub\)e)108 501.6 R .297(xpression or after another `|', i.e. an operand of `|' cannot be an)-.15 F 2.014(empty sube)108 513.6 R 4.514(xpression. An)-.15 F 2.014(empty parenthesized sube)4.514 F 2.015(xpression, `\(\)', is le)-.15 F-.05(ga)-.15 G 4.515(la).05 G 2.015(nd matches an empty)-4.515 F 2.5(\(sub\)string. An)108 525.6 R(empty string is not a le)2.5 E -.05(ga)-.15 G 2.5(lR).05 G(E.)-2.5 E 3.175(A`)108 542.4 S .675({' follo)-3.175F .675(wed by a digit is considered the be)-.25 F .675(ginning of bounds for a bounded repetition, which must)-.15 F(then follo)108 554.4 Q 2.5(wt)-.25 G(he syntax for bounds.)-2.5 E 2.5(A`)5 G({')-2.5 E F1(not)2.5 E F0(follo)2.5 E(wed by a digit is considered an ordinary character)-.25 E(.)-.55 E .926(`^' and `$' be)108 571.2 R .927(ginning and ending sube)-.15 F .927(xpressions in obsolete \(`)-.15 F(`basic')-.74 E .927('\) REs are anchors, not ordinary)-.74 F(characters.)108 583.2 Q F2(SEE ALSO)72 600 Q F0(grep\(1\), re)108 612 Q(ge)-.15 E(x\(7\))-.15 E.239(POSIX 1003.2, sections 2.8 \(Re)108 628.8 R .239(gular Expression Notation\) and B.5 \(C Binding for Re)-.15 F .238(gular Expression)-.15 F(Matching\).)108 640.8 Q F2(DIA)72 657.6 Q(GNOSTICS)-.602 E F0(Non-zero error codes from)108 669.6 Q F1 -.37(re)2.5 G(gcomp)-.03 E F0(and)2.5 E F1 -.37(re)2.5 G -.1(ge)-.03 G(xec)-.1 EF0(include the follo)2.5 E(wing:)-.25 E(REG_NOMA)108 686.4 Q 13.61(TCH re)-1.11 F(ge)-.15 E -.15(xe)-.15 G(c\(\) f).15 E(ailed to match)-.1 E(REG_B)108 698.4 Q(ADP)-.35 E 27.65 -1.11(AT i)-.92 H -1.95 -.4(nv a)1.11 H(lid re).4 E(gular e)-.15 E(xpression)-.15 E(REG_ECOLLA)108710.4 Q 12.5(TE in)-1.11 F -.25(va)-.4 G(lid collating element).25 E25.27(REG_ECTYPE in)108 722.4 R -.25(va)-.4 G(lid character class).25 E19.71(REG_EESCAPE \\)108 734.4 R(applied to unescapable character)2.5 E17.49(REG_ESUBREG in)108 746.4 R -.25(va)-.4 G(lid backreference number).25 E(REG_EBRA)108 758.4 Q 22.89(CK brack)-.4 F(ets [ ] not balanced)-.1E(REG_EP)108 770.4 Q 25.08(AREN parentheses)-.92 F 2.5(\(\)n)2.5 G(ot balanced)-2.5 E(25 Sept 1997)271.248 817.889 Q(3)194.247 E 0 Cg EP%%Page: 4 4%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Roman@0 SF 358.795(REGEX\(3\) REGEX\(3\))72 48 R(REG_EBRA)108 84 Q 24(CE braces)-.4 F 2.5({}n)2.5 G(ot balanced)-2.5 E(REG_B)10896 Q 28.95(ADBR in)-.35 F -.25(va)-.4 G(lid repetition count\(s\) in { }).25 E 22.5(REG_ERANGE in)108 108 R-.25(va)-.4 G(lid character range in [ ]).25 E(REG_ESP)108 120 Q -.4(AC)-.92 G 29.64(Er).4 G(an out of memory)-29.64 E(REG_B)108 132 Q 23.95(ADRPT ?,)-.35 F(*, or + operand in)2.5 E -.25(va)-.4 G(lid).25 E 29.16(REG_EMPTY empty)108 144 R(\(sub\)e)2.5 E(xpression)-.15 E(REG_ASSER)108156 Q 28.92(T`)-.6 G(`can')-29.66 E 2.5(th)-.18 G(appen')-2.5 E('\212you found a b)-.74 E(ug)-.2 E(REG_INV)108 168 Q 25.52(ARG in)-1.35F -.25(va)-.4 G(lid ar).25 E(gument, e.g. ne)-.18 E -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G(-length string).15 E/F1 10.95/Times-Bold@0 SF(HIST)72 184.8 Q(OR)-.197 E(Y)-.383 E F0(Written by Henry Spencer)108 196.8 Q2.5(,h)-.4 G(enry@zoo.toronto.edu.)-2.5 E F1 -.11(BU)72 213.6 S(GS).11 EF0(This is an alpha release with kno)108 225.6 Q(wn defects.)-.25 E(Please report problems.)5 E 1.035(There is one kno)108 242.4 R 1.035(wn functionality b)-.25 F 3.535(ug. The)-.2 F 1.036(implementation of internationalization is incomplete: the)3.535 F .854(locale is al)108 254.4 R -.1(wa)-.1 G .853(ys assumed to be the def).1F .853(ault one of 1003.2, and only the collating elements etc. of that)-.1 F(locale are a)108 266.4 Q -.25(va)-.2 G(ilable.).25 E(The back-ref\erence code is subtle and doubts linger about its correctness in comple)108 283.2 Q 2.5(xc)-.15 G(ases.)-2.5 E/F2 10/Times-Italic@0 SF(Re)108300 Q -.1(ge)-.4 G(xec)-.1 E F0 .276(performance is poor)2.776 F 5.277(.T)-.55 G .277(his will impro)-5.277 F .577 -.15(ve w)-.15 H .277(ith later releases.).15 F F2(Nmatc)5.277 E(h)-.15 E F0 -.15(ex)2.777 G.277(ceeding 0 is e).15 F(xpensi)-.15 E -.15(ve)-.25 G(;).15 E F2(nmatc)108 312 Q(h)-.15 E F0 -.15(ex)3.285 G .785(ceeding 1 is w).15 F(orse.)-.1 E F2(Re)5.785 E -.1(ge)-.4 G(xec)-.1 E F0 .784(is lar)3.284 F .784(gely insensiti)-.18 F 1.084 -.15(ve t)-.25 H 3.284(oR).15 G 3.284(Ec)-3.284 G(omple)-3.284 E(xity)-.15 E F2 -.2(ex)3.284 G(cept).2 E F0 .784(that back refer)3.284 F(-)-.2 E .609(ences are massi)108 324 R -.15(ve)-.25 G .609(ly e).15 F(xpensi)-.15 E -.15(ve)-.25 G 5.609(.R).15 G 3.109(El)-5.609 G .61(ength does matter; in particular)-3.109 F 3.11(,t)-.4 G.61(here is a strong speed bonus for)-3.11 F -.1(ke)108 336 S(eping RE \length under about 30 characters, with most special characters counting\ roughly double.).1 E F2(Re)108 352.8 Q(gcomp)-.4 E F0 1.352(implements bounded repetitions by macro e)3.852 F 1.352(xpansion, which is costly in time and space if)-.15 F 13.119(counts are lar)108 364.8 R 13.119(ge or bounded repetitions are nested.)-.18 F 13.12(An RE lik)18.12 F13.12(e, say)-.1 F(,)-.65 E .136(`\(\(\(\(a{1,100}\){1,100}\){1,100}\){1,100}\){1,100}' will \(e)108376.8 R -.15(ve)-.25 G .136(ntually\) run almost an).15 F 2.635(ye)-.15G .135(xisting machine out)-2.785 F(of sw)108 388.8 Q(ap space.)-.1 E1.701(There are suspected problems with response to obscure error condi\tions.)108 405.6 R(Notably)6.701 E 4.201(,c)-.65 G 1.702(ertain kinds of)-4.201 F .267(internal o)108 417.6 R -.15(ve)-.15 G(r\215o).15 E 1.567 -.65(w, p)-.25 H .267(roduced only by truly enormou\s REs or by multiply nested bounded repetitions, are).65 F(probably not handled well.)108 429.6 Q .288(Due to a mistak)108 446.4 R2.788(ei)-.1 G 2.788(n1)-2.788 G .288(003.2, things lik)-2.788 F 2.788(e`)-.1 G .288(a\)b' are le)-2.788 F -.05(ga)-.15 G 2.788(lR).05 G .289(Es because `\)' is a special character only in the)-2.788 F(presence of a pre)108 458.4 Q(vious unmatched `\('.)-.25 E(This can')5E 2.5(tb)-.18 G 2.5<658c>-2.5 G -.15(xe)-2.5 G 2.5(du).15 G(ntil the spec is \214x)-2.5 E(ed.)-.15 E 2.599(The standard')108 475.2R 5.099(sd)-.55 G 2.599(e\214nition of back references is v)-5.099 F5.099(ague. F)-.25 F 2.599(or e)-.15 F 2.598(xample, does `a\\\(\\\(b\\\)*\\2\\\)*d' match)-.15 F 2.5(`abbbd'? Until)108 487.2 R(the standard is clari\214ed, beha)2.5 E(vior in such cases should not be relied on.)-.2 E .854(The implementation of w)108 504 R .855(ord-boundary matching is a bit of a kludge, and b)-.1 F .855(ugs may lurk in combina-)-.2 F(tions of w)108 516 Q(ord-boundary matching and anchoring.)-.1 E 194.248(42)72 817.889 S 2.5(5S)-194.248 G(ept 1997)-2.5 E 0 Cg EP%%Page: 5 5%%BeginPageSetupBP%%EndPageSetup/F0 10/Times-Roman@0 SF 358.795(REGEX\(7\) REGEX\(7\))72 48 R 110.5 84EBEGIN[/Count 0 /Dest /section.REGEX.7.1 /Title (REGEX (7)) /OUT pdfmarkEEND 110.5 84 EBEGIN[/Dest /section.REGEX.7.1 /View [/XYZ -5 PL null] /DEST pdfmarkEEND/F0 10.95/Times-Bold@0 SF -.219(NA)72 88.8 S(ME).219 E/F1 10/Times-Roman@0 SF(re)108 100.8 Q(ge)-.15 E 2.5(x\255P)-.15 G(OSIX 1003.2 re)-2.5 E(gular e)-.15 E(xpressions)-.15 E F0(DESCRIPTION)72 117.6 Q F1(Re)108 129.6 Q .614(gular e)-.15 F .614(xpressions \(`)-.15 F(`RE')-.74 E -.55('s)-.74 G .613(\), as de\214ned in POSIX 1003.2, come in tw).55 F 3.113(of)-.1 G .613(orms: modern REs \(roughly)-3.113 F 1.359(those of)108 141.6 R/F2 10/Times-Italic@0 SF -.4(eg)3.859 G -.37(re).4 G(p).37 E F1 3.859(;1).19 G1.359(003.2 calls these `)-3.859 F(`e)-.74 E(xtended')-.15 E 3.859('R)-.74 G 1.359(Es\) and obsolete REs \(roughly those of)-3.859 F F2(ed)3.859 E F1 3.859(;1).77 G(003.2)-3.859 E -.74(``)108 153.6 S(basic').74E 2.934('R)-.74 G 2.934(Es\). Obsolete)-2.934 F .434(REs mostly e)2.934F .434(xist for backw)-.15 F .434(ard compatibility in some old programs; the)-.1 F 2.933(yw)-.15 G(ill)-2.933 E .269(be discussed at the end.)108 165.6 R .27(1003.2 lea)5.269F -.15(ve)-.2 G 2.77(ss).15 G .27(ome aspects of RE syntax and semantics open; `\207' marks deci-)-2.77 F(sions on these aspects that may not be fully portable to other 1003.2 \implementations.)108 177.6 Q 4.383(A\()108 194.4 S 1.883(modern\) RE is one\207 or more non-empty\207)-4.383 F F2(br)4.382 E(anc)-.15 E(hes)-.15 E F1 4.382(,s)C 1.882(eparated by `|'.)-4.382 F1.882(It matches an)6.882 F 1.882(ything that)-.15 F(matches one of the branches.)108 206.4 Q 3.182(Ab)108 223.2 S .682(ranch is one\207 or more)-3.182 F F2(pieces)3.182 E F1 3.182(,c)C 3.182(oncatenated. It)-3.182 F .683(matches a match for the \214rst, follo)3.182 F .683(wed by a match)-.25 F(for the second, etc.)108 235.2 Q3.622(Ap)108 252 S 1.122(iece is an)-3.622 F F2(atom)3.622 E F1 1.122(possibly follo)3.622 F 1.121(wed by a single\207 `*', `+', `?', or)-.25F F2(bound)3.621 E F1 6.121(.A)C 3.621(na)-6.121 G 1.121(tom follo)-3.621 F 1.121(wed by `*')-.25 F .072(matches a sequence of 0 or more matches of the atom.)108 264 R .072(An atom follo)5.072 F .073(wed by `+' matches a sequence of)-.25 F2.887(1o)108 276 S 2.887(rm)-2.887 G .387(ore matches of the atom.)-2.887 F .387(An atom follo)5.387 F .386(wed by `?' matches a sequence of 0 or 1 matches of the)-.25 F(atom.)108288 Q(A)108 304.8 Q F2(bound)2.934 E F1 .434(is `{' follo)2.934 F .435(wed by an unsigned decimal inte)-.25 F(ger)-.15 E 2.935(,p)-.4 G .435(ossibly follo)-2.935 F .435(wed by `,)-.25 F 2.935('p)-.7 G .435(ossibly follo)-2.935 F .435(wed by)-.25 F 2.443(another unsigned decimal inte)108 316.8 R(ger)-.15 E 4.943(,a)-.4 G -.1(lwa)-4.943 G 2.443(ys follo).1 F 2.443(wed by `}'.)-.25 F 2.442(The inte)7.442 F 2.442(gers must lie between 0 and)-.15 F .042
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -