From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#36496: [PATCH] Describe the rx notation in the lisp manual Date: Fri, 5 Jul 2019 16:13:52 +0200 Message-ID: References: <0C783D67-9502-408B-B845-5599BD596361@acm.org> <838stdbw8e.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_D28F5A43-DC10-41C8-9F84-6454D3CF8910" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="243048"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 36496@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 05 16:30:52 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hjPEd-0010le-To for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Jul 2019 16:30:48 +0200 Original-Received: from localhost ([::1]:53652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjP4s-0003o8-Rr for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Jul 2019 10:20:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47944) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjOzR-00086D-KY for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2019 10:15:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjOzQ-00024Y-6K for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2019 10:15:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44780) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjOzO-0001vm-HX for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2019 10:15:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hjOzO-0002eL-9a for bug-gnu-emacs@gnu.org; Fri, 05 Jul 2019 10:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Jul 2019 14:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 36496-submit@debbugs.gnu.org id=B36496.156233604710111 (code B ref 36496); Fri, 05 Jul 2019 14:15:02 +0000 Original-Received: (at 36496) by debbugs.gnu.org; 5 Jul 2019 14:14:07 +0000 Original-Received: from localhost ([127.0.0.1]:53601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hjOyV-0002d0-8Z for submit@debbugs.gnu.org; Fri, 05 Jul 2019 10:14:07 -0400 Original-Received: from mail1422c50.megamailservers.eu ([91.136.14.22]:51744 helo=mail102c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hjOyQ-0002cI-L2 for 36496@debbugs.gnu.org; Fri, 05 Jul 2019 10:14:04 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1562336035; bh=gAT+HO94RGASG9d+XSNOIyvt7oIaHh/mBOjW54pRm5E=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=sVgM/GWXapxShQ2ZZXMsSNNL8+gTMkIVQd0quTyBa/dPPd6JBXhgG6f8jvP//1Kgd puiFU1KRGITJYOFvbxP1lk3lWBfbdqCJ9fXYZHRvRTQn6PoleAcso5Ksh7yrmlC63S ullcRmddXqWxkiYEVEoZ3QL5X7z4Wu/H5iU+EKgI= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.1.64] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail102c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x65EDrug003193; Fri, 5 Jul 2019 14:13:54 +0000 In-Reply-To: <838stdbw8e.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B0212.5D1F5B23.0047, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=RfS+9Wlv c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=mDV3o1hIAAAA:8 a=N3lGIljWuHaA1jC4_XoA:9 a=CjuIK1q_8ugA:10 a=AZtGIUqoNFVW1yBK4W8A:9 a=B2y7HmGcmWMA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:162132 Archived-At: --Apple-Mail=_D28F5A43-DC10-41C8-9F84-6454D3CF8910 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 4 juli 2019 kl. 18.28 skrev Eli Zaretskii : >=20 > This is a large section. The ELisp reference is already a large book, > printed in two separate volumes. So I think if we want to include > this section, it will have to be on a separate file that is > conditionally included @ifnottex. >=20 > Alternatively, we could make this a separate manual. It is about 7-8 pages in all. One page could be saved by combining the = character class descriptions with the existing ones; they are basically = the same. However, that would probably preclude separation into separate = files or manuals. The category names also take up about one page, but that information = isn't available anywhere else, since those names are specific to rx. (It = would be nice if the names were defined along with the categories, but = that isn't the case at present.) I would prefer @ifnottex to having a separate manual, since one of the = points is to make rx feel like a part of elisp and a genuine, practical = alternative to regexp strings rather than an add-on. For example, the = "Complex Regexp Example" turned out to be a good place for an rx = version. The revised patch (attached) does not separate the contents, because I = wanted to hear your opinion on the matter first. >> The existing `rx' doc string can be left unchanged, or reduced to = something more concise, perhaps without a description of the entire rx = language but with a manual reference. Suggestions are welcome. >=20 > Yes, the doc string should be reduced to the summary of the > constructs. Good, let's do that when the changes to the manual are done. >> +Bind the name @var{ref} to a submatch that matches = @var{rx-expr}@enddots{}. > ^^^^^^^^^^^^^^^^^^^^^^^ > "Bind the symbol @var{ref}", no? Yes, thank you. >> +or, using shorter synonyms and written more compactly, >=20 > This last line needs @noindent before it. Added, and in another place. >> +@table @asis >> +@item @code{"some-string"} >=20 > Why @code{"..."} and not @samp{...}? The latter will look better both > in print and in Info format. I looked at the result in all formats (pdf, info, html) and came to the = opposite conclusion; it makes it clear that it's about a string literal. = It's not a strongly held opinion, however. >> +Corresponding string regexp: @samp{AB@dots{}} (subexpressions in = sequence). > ^^^^^^^^^^^^^^^^ > I think this should use @samp{@var{a}@var{b}@dots{}} instead. And > likewise for the other "corresponding string regexps". The reason is > that neither A nor B stand for themselves, literally, they are > meta-variables. Right; again I made experiments, and ended up with = @samp{var{A}@var{B}@dots{}}. The upper-case variables looked much better = in print and html. >> +Match the @var{rx}s once or not at all.@* >=20 > "Match @var{rx} or an empty string" sounds better to me. Much better, thank you. Changed in all places. >> +Match the @var{rx}s zero or more times, non-greedily.@* >=20 > I would add here a cross-reference to where greedy matching is > described. Done, with a separate sub subheading for the non-greedy stuff. >> +@item @code{(any @var{charset}@dots{})} >=20 > Please don't call this "charset", as that term is already taken by a > very different creature in Emacs. I suggest "character set" instead. Yes, I ended up using "set" since it's shorter and even better in this = case. >> +Each @var{charset} is a character, a string representing the set of >> +its characters, a range or a character class. A range is either a >> +hyphen-separated string like @code{"A-Z"}, or a cons of characters >> +like @code{(?A . ?Z)}. >=20 > Again, a cross-reference to where "character class" described would be > good here, as would a @cindex entry for "character class in rx". Done; the cross-reference is just a "see below" since it's very near. >> +@item @code{space}, @code{whitespace}, @code{white} >> +Match any character that has whitespace syntax. >=20 > Only ASCII or also non-ASCII? This should be spelled out. It's a matter of the syntax table; I used the exact formulation of the = existing char class description. >> +@xref{Syntax Class Table} for details. Please note that > ^ > Comma missing there. Ah, yes. Apparently, a comma is inserted automatically in the TeX = version, so that we get the desired "See Section XIV, page 123, for = details"; this is documented. In the info and html versions there is no = page number, so a comma doesn't feel like proper English: "See Section = XIV, for details" has a distinct German tone to my ears. Explicit comma after @xref seems to be common in the Emacs manuals, so = rather than to fight it out I castled the clauses. --Apple-Mail=_D28F5A43-DC10-41C8-9F84-6454D3CF8910 Content-Disposition: attachment; filename=0001-Describe-the-rx-notation-in-the-elisp-manual-bug-364.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Describe-the-rx-notation-in-the-elisp-manual-bug-364.patch" Content-Transfer-Encoding: quoted-printable =46rom=20fde854686146a1642c958e2871c4b376b1fe09a1=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Thu,=204=20Jul=202019=2013:01:52=20+0200=0A= Subject:=20[PATCH]=20Describe=20the=20rx=20notation=20in=20the=20elisp=20= manual=20(bug#36496)=0A=0A*=20doc/lispref/searching.texi=20(Regular=20= Expressions):=20New=20menu=20entry.=0A(Regexp=20Example):=20Add=20rx=20= form=20of=20the=20example.=0A(Rx=20Notation,=20Rx=20Constructs,=20Rx=20= Functions):=20New=20nodes.=0A*=20doc/lispref/control.texi=20(pcase=20= Macro):=20Describe=20the=20rx=20pattern.=0A---=0A=20= doc/lispref/control.texi=20=20=20|=20=2023=20++=0A=20= doc/lispref/searching.texi=20|=20559=20= +++++++++++++++++++++++++++++++++++++=0A=202=20files=20changed,=20582=20= insertions(+)=0A=0Adiff=20--git=20a/doc/lispref/control.texi=20= b/doc/lispref/control.texi=0Aindex=20e308d68b75..625964774d=20100644=0A= ---=20a/doc/lispref/control.texi=0A+++=20b/doc/lispref/control.texi=0A@@=20= -618,6=20+618,29=20@@=20pcase=20Macro=0A=20to=20@var{body-forms}=20(thus=20= avoiding=20an=20evaluation=20error=20on=20match),=0A=20if=20any=20of=20= the=20sub-patterns=20let-binds=20a=20set=20of=20symbols,=0A=20they=20= @emph{must}=20all=20bind=20the=20same=20set=20of=20symbols.=0A+=0A= +@anchor{rx=20in=20pcase}=0A+@item=20(rx=20@var{rx-expr}@dots{})=0A= +Matches=20strings=20against=20the=20regexp=20@var{rx-expr}@dots{},=20= using=20the=0A+@code{rx}=20regexp=20notation=20(@pxref{Rx=20Notation}),=20= as=20if=20by=0A+@code{string-match}.=0A+=0A+In=20addition=20to=20the=20= usual=20@code{rx}=20syntax,=20@var{rx-expr}@dots{}=20can=0A+contain=20= the=20following=20constructs:=0A+=0A+@table=20@code=0A+@item=20(let=20= @var{ref}=20@var{rx-expr}@dots{})=0A+Bind=20the=20symbol=20@var{ref}=20= to=20a=20submatch=20that=20matches=0A+@var{rx-expr}@enddots{}.=20=20= @var{ref}=20is=20bound=20in=20@var{body-forms}=20to=0A+the=20string=20of=20= the=20submatch=20or=20nil,=20but=20can=20also=20be=20used=20in=0A= +@code{backref}.=0A+=0A+@item=20(backref=20@var{ref})=0A+Like=20the=20= standard=20@code{backref}=20construct,=20but=20@var{ref}=20can=20here=0A= +also=20be=20a=20name=20introduced=20by=20a=20previous=20@code{(let=20= @var{ref}=20@dots{})}=0A+construct.=0A+@end=20table=0A+=0A=20@end=20= table=0A=20=0A=20@anchor{pcase-example-0}=0Adiff=20--git=20= a/doc/lispref/searching.texi=20b/doc/lispref/searching.texi=0Aindex=20= ef1cffc446..40a9cb523b=20100644=0A---=20a/doc/lispref/searching.texi=0A= +++=20b/doc/lispref/searching.texi=0A@@=20-254,6=20+254,7=20@@=20Regular=20= Expressions=0A=20@menu=0A=20*=20Syntax=20of=20Regexps::=20=20=20=20=20=20= =20Rules=20for=20writing=20regular=20expressions.=0A=20*=20Regexp=20= Example::=20=20=20=20=20=20=20=20=20=20Illustrates=20regular=20= expression=20syntax.=0A+*=20Rx=20Notation::=20=20=20=20=20=20=20=20=20=20= =20=20=20An=20alternative,=20structured=20regexp=20notation.=0A=20*=20= Regexp=20Functions::=20=20=20=20=20=20=20=20Functions=20for=20operating=20= on=20regular=20expressions.=0A=20@end=20menu=0A=20=0A@@=20-359,6=20= +360,7=20@@=20Regexp=20Special=0A=20preceding=20expression=20either=20= once=20or=20not=20at=20all.=20=20For=20example,=0A=20@samp{ca?r}=20= matches=20@samp{car}=20or=20@samp{cr};=20nothing=20else.=0A=20=0A= +@anchor{Non-greedy=20repetition}=0A=20@item=20@samp{*?},=20@samp{+?},=20= @samp{??}=0A=20@cindex=20non-greedy=20repetition=20characters=20in=20= regexp=0A=20These=20are=20@dfn{non-greedy}=20variants=20of=20the=20= operators=20@samp{*},=20@samp{+}=0A@@=20-951,6=20+953,563=20@@=20Regexp=20= Example=0A=20beyond=20the=20minimum=20needed=20to=20end=20a=20sentence.=0A= =20@end=20table=0A=20=0A+In=20the=20@code{rx}=20notation=20(@pxref{Rx=20= Notation}),=20the=20regexp=20could=20be=20written=0A+=0A+@example=0A= +@group=0A+(rx=20(any=20".?!")=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20;=20Punctuation=20ending=20sentence.=0A+=20=20=20=20= (zero-or-more=20(any=20"\"')]@}"))=20=20;=20Closing=20quotes=20or=20= brackets.=0A+=20=20=20=20(or=20line-end=0A+=20=20=20=20=20=20=20=20(seq=20= "=20"=20line-end)=0A+=20=20=20=20=20=20=20=20"\t"=0A+=20=20=20=20=20=20=20= =20"=20=20")=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20;=20Two=20spaces.=0A+=20=20=20=20(zero-or-more=20(any=20"\t\n=20")))=20= =20;=20Optional=20extra=20whitespace.=0A+@end=20group=0A+@end=20example=0A= +=0A+Since=20@code{rx}=20regexps=20are=20just=20S-expressions,=20they=20= can=20be=20formatted=0A+and=20commented=20as=20such.=0A+=0A+@node=20Rx=20= Notation=0A+@subsection=20The=20@code{rx}=20Structured=20Regexp=20= Notation=0A+@cindex=20rx=0A+@cindex=20regexp=20syntax=0A+=0A+=20=20As=20= an=20alternative=20to=20the=20string-based=20syntax,=20Emacs=20provides=20= the=0A+structured=20@code{rx}=20notation=20based=20on=20Lisp=20= S-expressions.=20=20This=0A+notation=20is=20usually=20easier=20to=20= read,=20write=20and=20maintain=20than=20regexp=0A+strings,=20and=20can=20= be=20indented=20and=20commented=20freely.=20=20It=20requires=20a=0A= +conversion=20into=20string=20form=20since=20that=20is=20what=20regexp=20= functions=0A+expect,=20but=20that=20conversion=20typically=20takes=20= place=20during=0A+byte-compilation=20rather=20than=20when=20the=20Lisp=20= code=20using=20the=20regexp=20is=0A+run.=0A+=0A+=20=20Here=20is=20an=20= @code{rx}=20regexp@footnote{It=20could=20be=20written=20much=0A+simpler=20= with=20non-greedy=20operators=20(how?),=20but=20that=20would=20make=20= the=0A+example=20less=20interesting.}=20that=20matches=20a=20block=20= comment=20in=20the=20C=0A+programming=20language:=0A+=0A+@example=0A= +@group=0A+(rx=20"/*"=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20;=20Initial=20/*=0A+=20=20=20=20(zero-or-more=0A= +=20=20=20=20=20(or=20(not=20(any=20"*"))=20=20=20=20=20=20=20=20=20=20;=20= =20Either=20non-*,=0A+=20=20=20=20=20=20=20=20=20(seq=20"*"=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20;=20=20or=20*=20followed=20by=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(not=20(any=20"/")))))=20=20;=20=20= non-/=0A+=20=20=20=20(one-or-more=20"*")=20=20=20=20=20=20=20=20=20=20=20= =20=20;=20At=20least=20one=20star,=0A+=20=20=20=20"/")=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;=20and=20the=20= final=20/=0A+@end=20group=0A+@end=20example=0A+=0A+@noindent=0A+or,=20= using=20shorter=20synonyms=20and=20written=20more=20compactly,=0A+=0A= +@example=0A+@group=0A+(rx=20"/*"=0A+=20=20=20=20(*=20(|=20(not=20(any=20= "*"))=0A+=20=20=20=20=20=20=20=20=20=20(:=20"*"=20(not=20(any=20"/")))))=0A= +=20=20=20=20(+=20"*")=20"/")=0A+@end=20group=0A+@end=20example=0A+=0A= +@noindent=0A+In=20conventional=20string=20syntax,=20it=20would=20be=20= written=0A+=0A+@example=0A+"/\\*\\(?:[^*]\\|\\*[^/]\\)*\\*+/"=0A+@end=20= example=0A+=0A+The=20@code{rx}=20notation=20is=20mainly=20useful=20in=20= Lisp=20code;=20it=20cannot=20be=0A+used=20in=20most=20interactive=20= situations=20where=20a=20regexp=20is=20requested,=20such=0A+as=20when=20= running=20@code{query-replace-regexp}=20or=20in=20variable=0A= +customisation.=0A+=0A+@menu=0A+*=20Rx=20Constructs::=20=20=20=20=20=20=20= Constructs=20valid=20in=20rx=20forms.=0A+*=20Rx=20Functions::=20=20=20=20= =20=20=20=20Functions=20and=20macros=20that=20use=20rx=20forms.=0A+@end=20= menu=0A+=0A+@node=20Rx=20Constructs=0A+@subsubsection=20Constructs=20in=20= @code{rx}=20regexps=0A+=0A+The=20various=20forms=20in=20@code{rx}=20= regexps=20are=20described=20below.=20=20The=0A+shorthand=20@var{rx}=20= represents=20any=20@code{rx}=20form,=20and=20@var{rx}@dots{}=0A+means=20= one=20or=20more=20@code{rx}=20forms.=20=20Where=20the=20corresponding=20= string=0A+regexp=20syntax=20is=20given,=20@var{A},=20@var{B},=20@dots{}=20= are=20string=20regexp=0A+subexpressions.=0A+@c=20With=20the=20new=20= implementation=20of=20rx,=20this=20can=20be=20changed=20from=0A+@c=20= 'one=20or=20more'=20to=20'zero=20or=20more'.=0A+=0A+@subsubheading=20= Literals=0A+=0A+@table=20@asis=0A+@item=20@code{"some-string"}=0A+Match=20= the=20string=20@samp{some-string}=20literally.=20=20There=20are=20no=0A= +characters=20with=20special=20meaning,=20unlike=20in=20string=20= regexps.=0A+=0A+@item=20@code{?C}=0A+Match=20the=20character=20@samp{C}=20= literally.=0A+@end=20table=0A+=0A+@subsubheading=20Fundamental=20= structure=0A+=0A+@table=20@asis=0A+@item=20@code{(seq=20= @var{rx}@dots{})}=0A+@cindex=20@code{seq}=20in=20rx=0A+@itemx=20= @code{(sequence=20@var{rx}@dots{})}=0A+@cindex=20@code{sequence}=20in=20= rx=0A+@itemx=20@code{(:=20@var{rx}@dots{})}=0A+@cindex=20@code{:}=20in=20= rx=0A+@itemx=20@code{(and=20@var{rx}@dots{})}=0A+@cindex=20@code{and}=20= in=20rx=0A+Match=20the=20@var{rx}s=20in=20sequence.=20=20Without=20= arguments,=20the=20expression=0A+matches=20the=20empty=20string.@*=0A= +Corresponding=20string=20regexp:=20@samp{@var{A}@var{B}@dots{}}=0A= +(subexpressions=20in=20sequence).=0A+=0A+@item=20@code{(or=20= @var{rx}@dots{})}=0A+@cindex=20@code{or}=20in=20rx=0A+@itemx=20@code{(|=20= @var{rx}@dots{})}=0A+@cindex=20@code{|}=20in=20rx=0A+Match=20exactly=20= one=20of=20the=20@var{rx}s,=20trying=20from=20left=20to=20right.=0A= +Without=20arguments,=20the=20expression=20will=20not=20match=20anything=20= at=20all.@*=0A+Corresponding=20string=20regexp:=20= @samp{@var{A}\|@var{B}\|@dots{}}.=0A+@end=20table=0A+=0A+@subsubheading=20= Repetition=0A+=0A+@table=20@code=0A+@item=20(zero-or-more=20= @var{rx}@dots{})=0A+@cindex=20@code{zero-or-more}=20in=20rx=0A+@itemx=20= (0+=20@var{rx}@dots{})=0A+@cindex=20@code{0+}=20in=20rx=0A+@itemx=20(*=20= @var{rx}@dots{})=0A+@cindex=20@code{*}=20in=20rx=0A+Match=20the=20= @var{rx}s=20zero=20or=20more=20times.@*=0A+Corresponding=20string=20= regexp:=20@samp{@var{A}*}=0A+=0A+@item=20(one-or-more=20@var{rx}@dots{})=0A= +@cindex=20@code{one-or-more}=20in=20rx=0A+@itemx=20(1+=20= @var{rx}@dots{})=0A+@cindex=20@code{1+}=20in=20rx=0A+@itemx=20(+=20= @var{rx}@dots{})=0A+@cindex=20@code{+}=20in=20rx=0A+Match=20the=20= @var{rx}s=20one=20or=20more=20times.@*=0A+Corresponding=20string=20= regexp:=20@samp{@var{A}+}=0A+=0A+@item=20(zero-or-one=20@var{rx}@dots{})=0A= +@cindex=20@code{zero-or-one}=20in=20rx=0A+@itemx=20(optional=20= @var{rx}@dots{})=0A+@cindex=20@code{optional}=20in=20rx=0A+@itemx=20(opt=20= @var{rx}@dots{})=0A+@cindex=20@code{opt}=20in=20rx=0A+@itemx=20(?=20= @var{rx}@dots{})=0A+@cindex=20@code{?}=20in=20rx=0A+Match=20the=20= @var{rx}s=20once=20or=20an=20empty=20string.@*=0A+Corresponding=20string=20= regexp:=20@samp{@var{A}?}=0A+=0A+@item=20(=3D=20@var{n}=20= @var{rx}@dots{})=0A+@cindex=20@code{=3D}=20in=20rx=0A+@itemx=20(repeat=20= @var{n}=20@var{rx})=0A+Match=20the=20@var{rx}s=20exactly=20@var{n}=20= times.@*=0A+Corresponding=20string=20regexp:=20= @samp{@var{A}\@{@var{n}\@}}=0A+=0A+@item=20(>=3D=20@var{n}=20= @var{rx}@dots{})=0A+@cindex=20@code{>=3D}=20in=20rx=0A+Match=20the=20= @var{rx}s=20@var{n}=20or=20more=20times.@*=0A+Corresponding=20string=20= regexp:=20@samp{@var{A}\@{@var{n},\@}}=0A+=0A+@item=20(**=20@var{n}=20= @var{m}=20@var{rx}@dots{})=0A+@cindex=20@code{**}=20in=20rx=0A+@itemx=20= (repeat=20@var{n}=20@var{m}=20@var{rx}@dots{})=0A+@cindex=20= @code{repeat}=20in=20rx=0A+Match=20the=20@var{rx}s=20at=20least=20= @var{n}=20but=20no=20more=20than=20@var{m}=20times.@*=0A+Corresponding=20= string=20regexp:=20@samp{@var{A}\@{@var{n},@var{m}\@}}=0A+@end=20table=0A= +=0A+@subsubheading=20Non-greedy=20repetition=0A+=0A+Normally,=20= repetition=20forms=20are=20greedy,=20in=20that=20they=20attempt=20to=20= match=0A+as=20many=20times=20as=20possible.=20=20The=20following=20three=20= forms=20are=20non-greedy;=20they=0A+try=20to=20match=20as=20few=20times=20= as=20possible=20(@pxref{Non-greedy=20repetition}).=0A+=0A+@table=20@code=0A= +@item=20(*?=20@var{rx}@dots{})=0A+@cindex=20@code{*?}=20in=20rx=0A= +Match=20the=20@var{rx}s=20zero=20or=20more=20times,=20non-greedily.@*=0A= +Corresponding=20string=20regexp:=20@samp{@var{A}*?}=0A+=0A+@item=20(+?=20= @var{rx}@dots{})=0A+@cindex=20@code{+?}=20in=20rx=0A+Match=20the=20= @var{rx}s=20one=20or=20more=20times,=20non-greedily.@*=0A+Corresponding=20= string=20regexp:=20@samp{@var{A}+?}=0A+=0A+@item=20(??=20= @var{rx}@dots{})=0A+@cindex=20@code{??}=20in=20rx=0A+Match=20the=20= @var{rx}s=20or=20an=20empty=20string,=20non-greedily.@*=0A+Corresponding=20= string=20regexp:=20@samp{@var{A}??}=0A+@end=20table=0A+=0A+The=20= greediness=20of=20some=20repetition=20forms=20can=20be=20controlled=20= using=20the=0A+following=20constructs.=20=20However,=20it=20is=20usually=20= better=20to=20use=20the=0A+explicit=20non-greedy=20forms=20above=20= instead.=0A+=0A+@table=20@code=0A+@item=20(minimal-match=20@var{rx})=0A= +@cindex=20@code{minimal-match}=20in=20rx=0A+Match=20@var{rx},=20with=20= @code{zero-or-more},=20@code{0+},=0A+@code{one-or-more},=20@code{1+},=20= @code{zero-or-one},=20@code{opt}=20and=0A+@code{option}=20using=20= non-greedy=20matching.=0A+=0A+@item=20(maximal-match=20@var{rx})=0A= +@cindex=20@code{maximal-match}=20in=20rx=0A+Match=20@var{rx},=20with=20= @code{zero-or-more},=20@code{0+},=0A+@code{one-or-more},=20@code{1+},=20= @code{zero-or-one},=20@code{opt}=20and=0A+@code{option}=20using=20= non-greedy=20matching.=20=20This=20is=20the=20default.=0A+@end=20table=0A= +=0A+@subsubheading=20Matching=20single=20characters=0A+=0A+@table=20= @asis=0A+@item=20@code{(any=20@var{set}@dots{})}=0A+@cindex=20@code{any}=20= in=20rx=0A+@itemx=20@code{(char=20@var{set}@dots{})}=0A+@cindex=20= @code{char}=20in=20rx=0A+@itemx=20@code{(in=20@var{set}@dots{})}=0A= +@cindex=20@code{in}=20in=20rx=0A+@cindex=20character=20class=20in=20rx=0A= +Match=20a=20single=20character=20from=20one=20of=20the=20@var{set}s.=20=20= Each=20@var{set}=0A+is=20a=20character,=20a=20string=20representing=20= the=20set=20of=20its=20characters,=20a=0A+range=20or=20a=20character=20= class=20(see=20below).=20=20A=20range=20is=20either=20a=0A= +hyphen-separated=20string=20like=20@code{"A-Z"},=20or=20a=20cons=20of=20= characters=0A+like=20@code{(?A=20.=20?Z)}.=0A+=0A+Note=20that=20hyphen=20= (@code{-})=20is=20special=20in=20strings=20in=20this=20construct,=0A= +since=20it=20acts=20as=20a=20range=20separator.=20=20To=20include=20a=20= hyphen,=20add=20it=20as=20a=0A+separate=20character=20or=20= single-character=20string.@*=0A+Corresponding=20string=20regexp:=20= @samp{[@dots{}]}=0A+=0A+@item=20@code{(not=20@var{charspec})}=0A+@cindex=20= @code{not}=20in=20rx=0A+Match=20a=20character=20not=20included=20in=20= @var{charspec}.=20=20@var{charspec}=20can=0A+be=20an=20@code{any},=20= @code{syntax}=20or=20@code{category}=20form,=20or=20a=0A+character=20= class.@*=0A+Corresponding=20string=20regexp:=20@samp{[^@dots{}]},=20= @samp{\S@var{code}},=0A+@samp{\C@var{code}}=0A+=0A+@item=20= @code{not-newline},=20@code{nonl}=0A+@cindex=20@code{not-newline}=20in=20= rx=0A+@cindex=20@code{nonl}=20in=20rx=0A+Match=20any=20character=20= except=20a=20newline.@*=0A+Corresponding=20string=20regexp:=20@samp{.}=20= (dot)=0A+=0A+@item=20@code{anything}=0A+@cindex=20@code{anything}=20in=20= rx=0A+Match=20any=20character.@*=0A+Corresponding=20string=20regexp:=20= @samp{.\|\n}=20(for=20example)=0A+=0A+@item=20character=20class=0A= +@cindex=20character=20class=20in=20rx=0A+Match=20a=20character=20from=20= a=20named=20character=20class:=0A+=0A+@table=20@asis=0A+@item=20= @code{alpha},=20@code{alphabetic},=20@code{letter}=0A+Match=20alphabetic=20= characters.=20=20More=20precisely,=20match=20characters=20whose=0A= +Unicode=20@samp{general-category}=20property=20indicates=20that=20they=20= are=0A+alphabetic.=0A+=0A+@item=20@code{alnum},=20@code{alphanumeric}=0A= +Match=20alphabetic=20characters=20and=20digits.=20=20More=20precisely,=20= match=0A+characters=20whose=20Unicode=20@samp{general-category}=20= property=20indicates=0A+that=20they=20are=20alphabetic=20or=20decimal=20= digits.=0A+=0A+@item=20@code{digit},=20@code{numeric},=20@code{num}=0A= +Match=20the=20digits=20@samp{0}--@samp{9}.=0A+=0A+@item=20= @code{xdigit},=20@code{hex-digit},=20@code{hex}=0A+Match=20the=20= hexadecimal=20digits=20@samp{0}--@samp{9},=20@samp{A}--@samp{F}=0A+and=20= @samp{a}--@samp{f}.=0A+=0A+@item=20@code{cntrl},=20@code{control}=0A= +Match=20any=20character=20whose=20code=20is=20in=20the=20range=200--31.=0A= +=0A+@item=20@code{blank}=0A+Match=20horizontal=20whitespace.=20=20More=20= precisely,=20match=20characters=20whose=0A+Unicode=20= @samp{general-category}=20property=20indicates=20that=20they=20are=0A= +spacing=20separators.=0A+=0A+@item=20@code{space},=20@code{whitespace},=20= @code{white}=0A+Match=20any=20character=20that=20has=20whitespace=20= syntax=0A+(@pxref{Syntax=20Class=20Table}).=0A+=0A+@item=20@code{lower},=20= @code{lower-case}=0A+Match=20anything=20lower-case,=20as=20determined=20= by=20the=20current=20case=20table.=0A+If=20@code{case-fold-search}=20is=20= non-nil,=20this=20also=20matches=20any=0A+upper-case=20letter.=0A+=0A= +@item=20@code{upper},=20@code{upper-case}=0A+Match=20anything=20= upper-case,=20as=20determined=20by=20the=20current=20case=20table.=0A+If=20= @code{case-fold-search}=20is=20non-nil,=20this=20also=20matches=20any=0A= +lower-case=20letter.=0A+=0A+@item=20@code{graph},=20@code{graphic}=0A= +Match=20any=20character=20except=20whitespace,=20@acronym{ASCII}=20and=0A= +non-@acronym{ASCII}=20control=20characters,=20surrogates,=20and=20= codepoints=0A+unassigned=20by=20Unicode,=20as=20indicated=20by=20the=20= Unicode=0A+@samp{general-category}=20property.=0A+=0A+@item=20= @code{print},=20@code{printing}=0A+Match=20whitespace=20or=20a=20= character=20matched=20by=20@code{graph}.=0A+=0A+@item=20@code{punct},=20= @code{punctuation}=0A+Match=20any=20punctuation=20character.=20=20(At=20= present,=20for=20multibyte=0A+characters,=20anything=20that=20has=20= non-word=20syntax.)=0A+=0A+@item=20@code{word},=20@code{wordchar}=0A= +Match=20any=20character=20that=20has=20word=20syntax=20(@pxref{Syntax=20= Class=20Table}).=0A+=0A+@item=20@code{ascii}=0A+Match=20any=20= @acronym{ASCII}=20character=20(codes=200--127).=0A+=0A+@item=20= @code{nonascii}=0A+Match=20any=20non-@acronym{ASCII}=20character=20(but=20= not=20raw=20bytes).=0A+@end=20table=0A+=0A+Corresponding=20string=20= regexp:=20@samp{[[:@var{class}:]]}=0A+=0A+@item=20@code{(syntax=20= @var{syntax})}=0A+@cindex=20@code{syntax}=20in=20rx=0A+Match=20a=20= character=20with=20syntax=20@var{syntax},=20being=20one=20of=20the=20= following=0A+names:=0A+=0A+@multitable=20{@code{close-parenthesis}}=20= {Syntax=20character}=0A+@headitem=20Syntax=20name=20=20=20=20=20=20=20=20= =20=20@tab=20Syntax=20character=0A+@item=20@code{whitespace}=20=20=20=20=20= =20=20=20@tab=20@code{-}=0A+@item=20@code{punctuation}=20=20=20=20=20=20=20= @tab=20@code{.}=0A+@item=20@code{word}=20=20=20=20=20=20=20=20=20=20=20=20= =20=20@tab=20@code{w}=0A+@item=20@code{symbol}=20=20=20=20=20=20=20=20=20= =20=20=20@tab=20@code{_}=0A+@item=20@code{open-parenthesis}=20=20@tab=20= @code{(}=0A+@item=20@code{close-parenthesis}=20@tab=20@code{)}=0A+@item=20= @code{expression-prefix}=20@tab=20@code{'}=0A+@item=20= @code{string-quote}=20=20=20=20=20=20@tab=20@code{"}=0A+@item=20= @code{paired-delimiter}=20=20@tab=20@code{$}=0A+@item=20@code{escape}=20=20= =20=20=20=20=20=20=20=20=20=20@tab=20@code{\}=0A+@item=20= @code{character-quote}=20=20=20@tab=20@code{/}=0A+@item=20= @code{comment-start}=20=20=20=20=20@tab=20@code{<}=0A+@item=20= @code{comment-end}=20=20=20=20=20=20=20@tab=20@code{>}=0A+@item=20= @code{string-delimiter}=20=20@tab=20@code{|}=0A+@item=20= @code{comment-delimiter}=20@tab=20@code{!}=0A+@end=20multitable=0A+=0A= +For=20details,=20@pxref{Syntax=20Class=20Table}.=20=20Please=20note=20= that=0A+@code{(syntax=20punctuation)}=20is=20@emph{not}=20equivalent=20= to=20the=20character=20class=0A+@code{punctuation}.@*=0A+Corresponding=20= string=20regexp:=20@samp{\s@var{code}}=0A+=0A+@item=20@code=20{(category=20= @var{category})}=0A+@cindex=20@code{category}=20in=20rx=0A+Match=20a=20= character=20in=20category=20@var{category},=20which=20is=20either=20one=20= of=0A+the=20names=20below=20or=20its=20category=20character.=0A+=0A= +@multitable=20{@code{vowel-modifying-diacritical-mark}}=20{Category=20= character}=0A+@headitem=20Category=20name=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20@tab=20Category=20character=0A+@item=20= @code{space-for-indent}=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= @tab=20space=0A+@item=20@code{base}=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20@tab=20@code{.}=0A+@item=20= @code{consonant}=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20@tab=20@code{0}=0A+@item=20@code{base-vowel}=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20@tab=20@code{1}=0A= +@item=20@code{upper-diacritical-mark}=20=20=20=20=20=20=20=20=20=20=20= @tab=20@code{2}=0A+@item=20@code{lower-diacritical-mark}=20=20=20=20=20=20= =20=20=20=20=20@tab=20@code{3}=0A+@item=20@code{tone-mark}=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20@tab=20@code{4}=0A= +@item=20@code{symbol}=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20@tab=20@code{5}=0A+@item=20@code{digit}=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20@tab=20@code{6}=0A+@item=20@code{vowel-modifying-diacritical-mark}=20= @tab=20@code{7}=0A+@item=20@code{vowel-sign}=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20@tab=20@code{8}=0A+@item=20= @code{semivowel-lower}=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20@tab=20@code{9}=0A+@item=20@code{not-at-end-of-line}=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20@tab=20@code{<}=0A+@item=20= @code{not-at-beginning-of-line}=20=20=20=20=20=20=20=20=20@tab=20= @code{>}=0A+@item=20@code{alpha-numeric-two-byte}=20=20=20=20=20=20=20=20= =20=20=20@tab=20@code{A}=0A+@item=20@code{chinese-two-byte}=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20@tab=20@code{C}=0A+@item=20= @code{greek-two-byte}=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20@tab=20@code{G}=0A+@item=20@code{japanese-hiragana-two-byte}=20=20=20=20= =20=20=20@tab=20@code{H}=0A+@item=20@code{indian-two-byte}=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20@tab=20@code{I}=0A+@item=20= @code{japanese-katakana-two-byte}=20=20=20=20=20=20=20@tab=20@code{K}=0A= +@item=20@code{strong-left-to-right}=20=20=20=20=20=20=20=20=20=20=20=20=20= @tab=20@code{L}=0A+@item=20@code{korean-hangul-two-byte}=20=20=20=20=20=20= =20=20=20=20=20@tab=20@code{N}=0A+@item=20@code{strong-right-to-left}=20=20= =20=20=20=20=20=20=20=20=20=20=20@tab=20@code{R}=0A+@item=20= @code{cyrillic-two-byte}=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= @tab=20@code{Y}=0A+@item=20@code{combining-diacritic}=20=20=20=20=20=20=20= =20=20=20=20=20=20=20@tab=20@code{^}=0A+@item=20@code{ascii}=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= @tab=20@code{a}=0A+@item=20@code{arabic}=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20@tab=20@code{b}=0A+@item=20= @code{chinese}=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20@tab=20@code{c}=0A+@item=20@code{ethiopic}=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20@tab=20= @code{e}=0A+@item=20@code{greek}=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20@tab=20@code{g}=0A+@item=20= @code{korean}=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20@tab=20@code{h}=0A+@item=20@code{indian}=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= @tab=20@code{i}=0A+@item=20@code{japanese}=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20@tab=20@code{j}=0A+@item=20= @code{japanese-katakana}=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= @tab=20@code{k}=0A+@item=20@code{latin}=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20@tab=20@code{l}=0A+@item=20= @code{lao}=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20@tab=20@code{o}=0A+@item=20@code{tibetan}=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= @tab=20@code{q}=0A+@item=20@code{japanese-roman}=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20@tab=20@code{r}=0A+@item=20@code{thai}=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20@tab=20@code{t}=0A+@item=20@code{vietnamese}=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20@tab=20@code{v}=0A+@item=20= @code{hebrew}=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20@tab=20@code{w}=0A+@item=20@code{cyrillic}=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20@tab=20= @code{y}=0A+@item=20@code{can-break}=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20@tab=20@code{|}=0A+@end=20multitable=0A= +=0A+For=20more=20information=20about=20currently=20defined=20= categories,=20run=20the=0A+command=20@kbd{M-x=20describe-categories=20= @key{RET}}.=20=20For=20how=20to=20define=0A+new=20categories,=20= @pxref{Categories}.@*=0A+Corresponding=20string=20regexp:=20= @samp{\c@var{code}}=0A+@end=20table=0A+=0A+@subsubheading=20Zero-width=20= assertions=0A+=0A+These=20all=20match=20the=20empty=20string,=20but=20= only=20in=20specific=20places.=0A+=0A+@table=20@asis=0A+@item=20= @code{line-start},=20@code{bol}=0A+@cindex=20@code{line-start}=20in=20rx=0A= +@cindex=20@code{bol}=20in=20rx=0A+Match=20at=20the=20beginning=20of=20a=20= line.@*=0A+Corresponding=20string=20regexp:=20@samp{^}=0A+=0A+@item=20= @code{line-end},=20@code{eol}=0A+@cindex=20@code{line-end}=20in=20rx=0A= +@cindex=20@code{eol}=20in=20rx=0A+Match=20at=20the=20end=20of=20a=20= line.@*=0A+Corresponding=20string=20regexp:=20@samp{$}=0A+=0A+@item=20= @code{string-start},=20@code{bos},=20@code{buffer-start},=20@code{bot}=0A= +@cindex=20@code{string-start}=20in=20rx=0A+@cindex=20@code{bos}=20in=20= rx=0A+@cindex=20@code{buffer-start}=20in=20rx=0A+@cindex=20@code{bot}=20= in=20rx=0A+Match=20at=20the=20start=20of=20the=20string=20or=20buffer=20= being=20matched=20against.@*=0A+Corresponding=20string=20regexp:=20= @samp{\`}=0A+=0A+@item=20@code{string-end},=20@code{eos},=20= @code{buffer-end},=20@code{eot}=0A+@cindex=20@code{string-end}=20in=20rx=0A= +@cindex=20@code{eos}=20in=20rx=0A+@cindex=20@code{buffer-end}=20in=20rx=0A= +@cindex=20@code{eot}=20in=20rx=0A+Match=20at=20the=20end=20of=20the=20= string=20or=20buffer=20being=20matched=20against.@*=0A+Corresponding=20= string=20regexp:=20@samp{\'}=0A+=0A+@item=20@code{point}=0A+@cindex=20= @code{point}=20in=20rx=0A+Match=20at=20point.@*=0A+Corresponding=20= string=20regexp:=20@samp{\=3D}=0A+=0A+@item=20@code{word-start}=0A= +@cindex=20@code{word-start}=20in=20rx=0A+Match=20at=20the=20beginning=20= of=20a=20word.@*=0A+Corresponding=20string=20regexp:=20@samp{\<}=0A+=0A= +@item=20@code{word-end}=0A+@cindex=20@code{word-end}=20in=20rx=0A+Match=20= at=20the=20end=20of=20a=20word.@*=0A+Corresponding=20string=20regexp:=20= @samp{\>}=0A+=0A+@item=20@code{word-boundary}=0A+@cindex=20= @code{word-boundary}=20in=20rx=0A+Match=20at=20the=20beginning=20or=20= end=20of=20a=20word.@*=0A+Corresponding=20string=20regexp:=20@samp{\b}=0A= +=0A+@item=20@code{not-word-boundary}=0A+@cindex=20= @code{not-word-boundary}=20in=20rx=0A+Match=20anywhere=20but=20at=20the=20= beginning=20or=20end=20of=20a=20word.@*=0A+Corresponding=20string=20= regexp:=20@samp{\B}=0A+=0A+@item=20@code{symbol-start}=0A+@cindex=20= @code{symbol-start}=20in=20rx=0A+Match=20at=20the=20beginning=20of=20a=20= symbol.@*=0A+Corresponding=20string=20regexp:=20@samp{\_<}=0A+=0A+@item=20= @code{symbol-end}=0A+@cindex=20@code{symbol-end}=20in=20rx=0A+Match=20at=20= the=20end=20of=20a=20symbol.@*=0A+Corresponding=20string=20regexp:=20= @samp{\_>}=0A+@end=20table=0A+=0A+@subsubheading=20Capture=20groups=0A+=0A= +@table=20@code=0A+@item=20(group=20@var{rx}@dots{})=0A+@cindex=20= @code{group}=20in=20rx=0A+@itemx=20(submatch=20@var{rx}@dots{})=0A= +@cindex=20@code{submatch}=20in=20rx=0A+Match=20the=20@var{rx}s,=20= making=20the=20matched=20text=20and=20position=20accessible=0A+in=20the=20= match=20data.=20=20The=20first=20group=20in=20a=20regexp=20is=20numbered=20= 1;=0A+subsequent=20groups=20will=20be=20numbered=20one=20higher=20than=20= the=20previous=0A+group.@*=0A+Corresponding=20string=20regexp:=20= @samp{\(@dots{}\)}=0A+=0A+@item=20(group-n=20@var{n}=20@var{rx}@dots{})=0A= +@cindex=20@code{group-n}=20in=20rx=0A+@itemx=20(submatch-n=20@var{n}=20= @var{rx}@dots{})=0A+@cindex=20@code{submatch-n}=20in=20rx=0A+Like=20= @code{group},=20but=20explicitly=20assign=20the=20group=20number=20= @var{n}.=0A+@var{n}=20must=20be=20positive.@*=0A+Corresponding=20string=20= regexp:=20@samp{\(?@var{n}:@dots{}\)}=0A+=0A+@item=20(backref=20@var{n})=0A= +@cindex=20@code{backref}=20in=20rx=0A+Match=20the=20text=20previously=20= matched=20by=20group=20number=20@var{n}.=0A+@var{n}=20must=20be=20in=20= the=20range=201--9.@*=0A+Corresponding=20string=20regexp:=20= @samp{\@var{n}}=0A+@end=20table=0A+=0A+@subsubheading=20Dynamic=20= inclusion=0A+=0A+@table=20@code=0A+@item=20(literal=20@var{expr})=0A= +@cindex=20@code{literal}=20in=20rx=0A+Match=20the=20literal=20string=20= that=20is=20the=20result=20from=20evaluating=20the=20Lisp=0A+expression=20= @var{expr}.=20=20The=20evaluation=20takes=20place=20at=20call=20time,=20= in=0A+the=20current=20lexical=20environment.=0A+=0A+@item=20(regexp=20= @var{expr})=0A+@cindex=20@code{regexp}=20in=20rx=0A+@itemx=20(regex=20= @var{expr})=0A+@cindex=20@code{regex}=20in=20rx=0A+Match=20the=20string=20= regexp=20that=20is=20the=20result=20from=20evaluating=20the=20Lisp=0A= +expression=20@var{expr}.=20=20The=20evaluation=20takes=20place=20at=20= call=20time,=20in=0A+the=20current=20lexical=20environment.=0A+=0A+@item=20= (eval=20@var{expr})=0A+@cindex=20@code{eval}=20in=20rx=0A+Match=20the=20= rx=20form=20that=20is=20the=20result=20from=20evaluating=20the=20Lisp=0A= +expression=20@var{expr}.=20=20The=20evaluation=20takes=20place=20at=20= macro-expansion=0A+time=20for=20@code{rx},=20at=20call=20time=20for=20= @code{rx-to-string},=0A+in=20the=20current=20global=20environment.=0A= +@end=20table=0A+=0A+@node=20Rx=20Functions=0A+@subsubsection=20= Functions=20and=20macros=20using=20@code{rx}=20regexps=0A+=0A+@defmac=20= rx=20rx-expr@dots{}=0A+Translate=20the=20@var{rx-expr}s=20to=20a=20= string=20regexp,=20as=20if=20they=20were=20the=0A+body=20of=20a=20= @code{(seq=20@dots{})}=20form.=20=20The=20@code{rx}=20macro=20expands=20= to=20a=0A+string=20constant,=20or,=20if=20@code{literal}=20or=20= @code{regexp}=20forms=20are=0A+used,=20a=20Lisp=20expression=20that=20= evaluates=20to=20a=20string.=0A+@end=20defmac=0A+=0A+@defun=20= rx-to-string=20rx-expr=20&optional=20no-group=0A+Translate=20= @var{rx-expr}=20to=20a=20string=20regexp=20which=20is=20returned.=0A+If=20= @var{no-group}=20is=20absent=20or=20nil,=20bracket=20the=20result=20in=20= a=0A+non-capturing=20group,=20@samp{\(?:@dots{}\)},=20if=20necessary=20= to=20ensure=20that=0A+a=20postfix=20operator=20appended=20to=20it=20will=20= apply=20to=20the=20whole=20expression.=0A+=0A+Arguments=20to=20= @code{literal}=20and=20@code{regexp}=20forms=20in=20@var{rx-expr}=0A= +must=20be=20string=20literals.=0A+@end=20defun=0A+=0A+The=20= @code{pcase}=20macro=20can=20use=20@code{rx}=20expressions=20as=20= patterns=0A+directly;=20@pxref{rx=20in=20pcase}.=0A+=0A=20@node=20Regexp=20= Functions=0A=20@subsection=20Regular=20Expression=20Functions=0A=20=0A--=20= =0A2.20.1=20(Apple=20Git-117)=0A=0A= --Apple-Mail=_D28F5A43-DC10-41C8-9F84-6454D3CF8910--