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: Thu, 4 Jul 2019 14:13:26 +0200 Message-ID: <0C783D67-9502-408B-B845-5599BD596361@acm.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_E9E5D2A6-19E7-48F8-AEEE-166FC0867929" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="93289"; mail-complaints-to="usenet@blaine.gmane.org" To: 36496@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 04 14:14:12 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 1hj0ct-000O6p-Hv for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Jul 2019 14:14:12 +0200 Original-Received: from localhost ([::1]:45188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hj0cs-00035L-02 for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Jul 2019 08:14:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38829) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hj0cl-000354-SF for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2019 08:14:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hj0ck-0002nA-Aa for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2019 08:14:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41681) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hj0ck-0002my-4Q for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2019 08:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hj0cj-0008IA-Tc for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2019 08:14:01 -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: Thu, 04 Jul 2019 12:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.156224242131838 (code B ref -1); Thu, 04 Jul 2019 12:14:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Jul 2019 12:13:41 +0000 Original-Received: from localhost ([127.0.0.1]:50502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hj0cP-0008HS-7G for submit@debbugs.gnu.org; Thu, 04 Jul 2019 08:13:41 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:59802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hj0cM-0008HJ-DS for submit@debbugs.gnu.org; Thu, 04 Jul 2019 08:13:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38767) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hj0cL-00034i-FF for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2019 08:13:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hj0cK-0002Tk-39 for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2019 08:13:37 -0400 Original-Received: from mail202c50.megamailservers.eu ([91.136.10.212]:33340 helo=mail193c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hj0cJ-0002R1-7W for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2019 08:13:36 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1562242409; bh=HCflxMh9LeueWq4EQrI+y2N4iTlY/ASbWaz6/bqTodQ=; h=From:Subject:Date:To:From; b=WShy64rgHklLe+Tc8EcjFnyVWiSc29j8crtdqp0E1WFiEOtvP48MAWI6tPpgXSVDB +dp4UJu0cs7mjS5q54F3NGKtJcb4qFjpnMejbDiIPXu08fSRjX5Tfw8ju2Vt7AYmto +mvcOLwxZGEB1x1234EjuUKsfp8pls60O28ce34E= 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 mail193c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x64CDQwU032390 for ; Thu, 4 Jul 2019 12:13:28 +0000 X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B0213.5D1DED68.0061, 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=KsZjJ1eN c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=skeJG0nVuyxeInlwYjwA:9 a=CjuIK1q_8ugA:10 a=Mc4eKmbE7MwFId0pkWMA:9 a=B2y7HmGcmWMA:10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] 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:162046 Archived-At: --Apple-Mail=_E9E5D2A6-19E7-48F8-AEEE-166FC0867929 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii The rx notation is useful and complex enough to merit inclusion in the = manual. Right now, it's mainly described in the `rx' doc string, which is fairly = well-written but quite long and a bit unstructured. Describing it in the = manual permits a different pace and style of exposition, the inclusion = of examples and related information, structured into separate sections = with cross-references. Proposed patch attached. It covers all rx features, functions, macros, = including the pcase pattern, and a mention of the corresponding string = regexp constructs. 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. --Apple-Mail=_E9E5D2A6-19E7-48F8-AEEE-166FC0867929 Content-Disposition: attachment; filename=0001-Describe-the-rx-notation-in-the-elisp-manual.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Describe-the-rx-notation-in-the-elisp-manual.patch" Content-Transfer-Encoding: quoted-printable =46rom=20770ce5fad60ea6449881cc2578c365c2724eda56=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=0A=0A*=20doc/lispref/searching.texi=20(Regular=20Expressions):=20= New=20menu=20entry.=0A(Regexp=20Example):=20Add=20rx=20form=20of=20the=20= example.=0A(Rx=20Notation,=20Rx=20Constructs,=20Rx=20Functions):=20New=20= nodes.=0A*=20doc/lispref/control.texi=20(pcase=20Macro):=20Describe=20= the=20rx=20pattern.=0A---=0A=20doc/lispref/control.texi=20=20=20|=20=20= 21=20++=0A=20doc/lispref/searching.texi=20|=20525=20= +++++++++++++++++++++++++++++++++++++=0A=202=20files=20changed,=20546=20= insertions(+)=0A=0Adiff=20--git=20a/doc/lispref/control.texi=20= b/doc/lispref/control.texi=0Aindex=20e308d68b75..f7361fed11=20100644=0A= ---=20a/doc/lispref/control.texi=0A+++=20b/doc/lispref/control.texi=0A@@=20= -618,6=20+618,27=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+@item=20= (rx=20@var{rx-expr}@dots{})=0A+Matches=20strings=20against=20the=20= regexp=20@var{rx-expr}@dots{},=20using=20the=0A+@code{rx}=20regexp=20= notation=20(@pxref{Rx=20Notation}),=20as=20if=20by=0A= +@code{string-match}.=0A+=0A+In=20addition=20to=20the=20usual=20= @code{rx}=20syntax,=20@var{rx-expr}@dots{}=20can=0A+contain=20the=20= following=20constructs:=0A+=0A+@table=20@code=0A+@item=20(let=20= @var{ref}=20@var{rx-expr}@dots{})=0A+Bind=20the=20name=20@var{ref}=20to=20= a=20submatch=20that=20matches=20@var{rx-expr}@enddots{}.=0A+@var{ref}=20= is=20bound=20in=20@var{body-forms}=20to=20the=20string=20of=20the=20= submatch=0A+or=20nil,=20but=20can=20also=20be=20used=20in=20= @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..b3b4ed3638=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-951,6=20= +952,530=20@@=20Regexp=20Example=0A=20beyond=20the=20minimum=20needed=20= to=20end=20a=20sentence.=0A=20@end=20table=0A=20=0A+In=20the=20@code{rx}=20= notation=20(@pxref{Rx=20Notation}),=20the=20regexp=20could=20be=20= written=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=20= sentence.=0A+=20=20=20=20(zero-or-more=20(any=20"\"')]@}"))=20=20;=20= Closing=20quotes=20or=20brackets.=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=20= whitespace.=0A+@end=20group=0A+@end=20example=0A+=0A+Since=20@code{rx}=20= regexps=20are=20just=20S-expressions,=20they=20can=20be=20formatted=0A= +and=20commented=20as=20such.=0A+=0A+@node=20Rx=20Notation=0A= +@subsection=20The=20@code{rx}=20Structured=20Regexp=20Notation=0A= +@cindex=20rx=0A+@cindex=20regexp=20syntax=0A+=0A+=20=20As=20an=20= alternative=20to=20the=20string-based=20syntax,=20Emacs=20provides=20the=0A= +structured=20@code{rx}=20notation=20based=20on=20Lisp=20forms.=20=20= This=20notation=20is=0A+usually=20easier=20to=20read,=20write=20and=20= maintain=20than=20regexp=20strings,=20and=0A+can=20be=20indented=20and=20= commented=20freely.=20=20It=20requires=20a=20conversion=20into=0A+string=20= form=20since=20that=20is=20what=20regexp=20functions=20expect,=20but=20= that=0A+conversion=20typically=20takes=20place=20during=20= byte-compilation=20rather=20than=0A+when=20the=20Lisp=20code=20using=20= the=20regexp=20is=20run.=0A+=0A+=20=20Here=20is=20an=20@code{rx}=20= regexp@footnote{It=20could=20be=20written=20much=0A+simpler=20with=20= non-greedy=20operators=20(how?),=20but=20that=20would=20make=20the=0A= +example=20less=20interesting.}=20that=20matches=20a=20block=20comment=20= in=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=20= non-*,=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=20non-/=0A+=20=20= =20=20(one-or-more=20"*")=20=20=20=20=20=20=20=20=20=20=20=20=20;=20At=20= least=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=20final=20/=0A= +@end=20group=0A+@end=20example=0A+=0A+or,=20using=20shorter=20synonyms=20= and=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+In=20conventional=20string=20= syntax,=20it=20would=20be=20written=0A+=0A+@example=0A= +"/\\*\\(?:[^*]\\|\\*[^/]\\)*\\*+/"=0A+@end=20example=0A+=0A+The=20= @code{rx}=20notation=20is=20mainly=20useful=20in=20Lisp=20code;=20it=20= cannot=20be=0A+used=20in=20most=20interactive=20situations=20where=20a=20= regexp=20is=20requested,=20such=0A+as=20when=20running=20= @code{query-replace-regexp}=20or=20in=20variable=0A+customisation.=0A+=0A= +@menu=0A+*=20Rx=20Constructs::=20=20=20=20=20=20=20Constructs=20valid=20= in=20rx=20forms.=0A+*=20Rx=20Functions::=20=20=20=20=20=20=20=20= Functions=20and=20macros=20that=20use=20rx=20forms.=0A+@end=20menu=0A+=0A= +@node=20Rx=20Constructs=0A+@subsubsection=20Constructs=20in=20@code{rx}=20= regexps=0A+=0A+The=20various=20forms=20in=20@code{rx}=20regexps=20are=20= described=20below.=20=20The=0A+shorthand=20@var{rx}=20represents=20any=20= @code{rx}=20form,=20and=20@var{rx}@dots{}=0A+means=20one=20or=20more=20= @code{rx}=20forms.=20=20Where=20the=20corresponding=20string=0A+regexp=20= syntax=20is=20given,=20@samp{A},=20@samp{B},=20@dots{}=20are=20string=20= regexp=0A+subexpressions.=0A+@c=20With=20the=20new=20implementation=20of=20= rx,=20this=20can=20be=20changed=20from=0A+@c=20'one=20or=20more'=20to=20= 'zero=20or=20more'.=0A+=0A+@subsubheading=20Literals=0A+=0A+@table=20= @asis=0A+@item=20@code{"some-string"}=0A+Matches=20the=20string=20= @samp{some-string}=20literally.=20=20There=20are=20no=0A+characters=20= with=20special=20meaning,=20unlike=20in=20string=20regexps.=0A+=0A+@item=20= @code{?C}=0A+Matches=20the=20character=20@samp{C}=20literally.=0A+@end=20= table=0A+=0A+@subsubheading=20Fundamental=20structure=0A+=0A+@table=20= @asis=0A+@item=20@code{(seq=20@var{rx}@dots{})}=0A+@cindex=20@samp{seq}=20= in=20rx=0A+@itemx=20@code{(sequence=20@var{rx}@dots{})}=0A+@cindex=20= @samp{sequence}=20in=20rx=0A+@itemx=20@code{(:=20@var{rx}@dots{})}=0A= +@cindex=20@samp{:}=20in=20rx=0A+@itemx=20@code{(and=20@var{rx}@dots{})}=0A= +@cindex=20@samp{and}=20in=20rx=0A+Match=20the=20@var{rx}s=20in=20= sequence.=20=20Without=20arguments,=20the=20expression=0A+matches=20the=20= empty=20string.@*=0A+Corresponding=20string=20regexp:=20@samp{AB@dots{}}=20= (subexpressions=20in=20sequence).=0A+=0A+@item=20@code{(or=20= @var{rx}@dots{})}=0A+@cindex=20@samp{or}=20in=20rx=0A+@itemx=20@code{(|=20= @var{rx}@dots{})}=0A+@cindex=20@samp{|}=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{A\|B\|@dots{}}.=0A= +@end=20table=0A+=0A+@subsubheading=20Repetition=0A+=0A+@table=20@code=0A= +@item=20(zero-or-more=20@var{rx}@dots{})=0A+@cindex=20= @samp{zero-or-more}=20in=20rx=0A+@itemx=20(0+=20@var{rx}@dots{})=0A= +@cindex=20@samp{0+}=20in=20rx=0A+@itemx=20(*=20@var{rx}@dots{})=0A= +@cindex=20@samp{*}=20in=20rx=0A+Match=20the=20@var{rx}s=20zero=20or=20= more=20times.@*=0A+Corresponding=20string=20regexp:=20@samp{A*}=0A+=0A= +@item=20(one-or-more=20@var{rx}@dots{})=0A+@cindex=20@samp{one-or-more}=20= in=20rx=0A+@itemx=20(1+=20@var{rx}@dots{})=0A+@cindex=20@samp{1+}=20in=20= rx=0A+@itemx=20(+=20@var{rx}@dots{})=0A+@cindex=20@samp{+}=20in=20rx=0A= +Match=20the=20@var{rx}s=20one=20or=20more=20times.@*=0A+Corresponding=20= string=20regexp:=20@samp{A+}=0A+=0A+@item=20(zero-or-one=20= @var{rx}@dots{})=0A+@cindex=20@samp{zero-or-one}=20in=20rx=0A+@itemx=20= (optional=20@var{rx}@dots{})=0A+@cindex=20@samp{optional}=20in=20rx=0A= +@itemx=20(opt=20@var{rx}@dots{})=0A+@cindex=20@samp{opt}=20in=20rx=0A= +@itemx=20(?=20@var{rx}@dots{})=0A+@cindex=20@samp{?}=20in=20rx=0A+Match=20= the=20@var{rx}s=20once=20or=20not=20at=20all.@*=0A+Corresponding=20= string=20regexp:=20@samp{A?}=0A+=0A+@item=20(*?=20@var{rx}@dots{})=0A= +@cindex=20@samp{*?}=20in=20rx=0A+Match=20the=20@var{rx}s=20zero=20or=20= more=20times,=20non-greedily.@*=0A+Corresponding=20string=20regexp:=20= @samp{A*?}=0A+=0A+@item=20(+?=20@var{rx}@dots{})=0A+@cindex=20@samp{+?}=20= in=20rx=0A+Match=20the=20@var{rx}s=20one=20or=20more=20times,=20= non-greedily.@*=0A+Corresponding=20string=20regexp:=20@samp{A+?}=0A+=0A= +@item=20(??=20@var{rx}@dots{})=0A+@cindex=20@samp{??}=20in=20rx=0A= +Match=20the=20@var{rx}s=20once=20or=20not=20at=20all,=20non-greedily.@*=0A= +Corresponding=20string=20regexp:=20@samp{A??}=0A+=0A+@item=20(=3D=20= @var{n}=20@var{rx}@dots{})=0A+@cindex=20@samp{=3D}=20in=20rx=0A+@itemx=20= (repeat=20@var{n}=20@var{rx})=0A+Match=20the=20@var{rx}s=20exactly=20= @var{n}=20times.@*=0A+Corresponding=20string=20regexp:=20= @samp{A\@{@var{n}\@}}=0A+=0A+@item=20(>=3D=20@var{n}=20@var{rx}@dots{})=0A= +@cindex=20@samp{>=3D}=20in=20rx=0A+Match=20the=20@var{rx}s=20@var{n}=20= or=20more=20times.@*=0A+Corresponding=20string=20regexp:=20= @samp{A\@{@var{n},\@}}=0A+=0A+@item=20(**=20@var{n}=20@var{m}=20= @var{rx}@dots{})=0A+@cindex=20@samp{**}=20in=20rx=0A+@itemx=20(repeat=20= @var{n}=20@var{m}=20@var{rx}@dots{})=0A+@cindex=20@samp{repeat}=20in=20= rx=0A+Match=20the=20@var{rx}s=20at=20least=20@var{n}=20but=20no=20more=20= than=20@var{m}=20times.@*=0A+Corresponding=20string=20regexp:=20= @samp{A\@{@var{n},@var{m}\@}}=0A+=0A+@item=20(minimal-match=20@var{rx})=0A= +@cindex=20@samp{minimal-match}=20in=20rx=0A+Match=20@var{rx},=20with=20= @code{zero-or-more},=20@code{one-or-more}=20and=0A+@code{zero-or-more}=20= and=20their=20synonyms=20@emph{except}=20@code{*},=0A+@code{+}=20and=20= @code{?}=20using=20non-greedy=20matching.=0A+=0A+@item=20(maximal-match=20= @var{rx})=0A+@cindex=20@samp{maximal-match}=20in=20rx=0A+Match=20= @var{rx},=20with=20@code{zero-or-more},=20@code{one-or-more}=20and=0A= +@code{zero-or-more}=20and=20their=20synonyms=20using=20greedy=20= matching.=0A+This=20is=20the=20default.=0A+@end=20table=0A+=0A= +@subsubheading=20Matching=20single=20characters=0A+=0A+@table=20@asis=0A= +@item=20@code{(any=20@var{charset}@dots{})}=0A+@cindex=20@samp{any}=20= in=20rx=0A+@itemx=20@code{(char=20@var{charset}@dots{})}=0A+@cindex=20= @samp{char}=20in=20rx=0A+@itemx=20@code{(in=20@var{charset}@dots{})}=0A= +@cindex=20@samp{in}=20in=20rx=0A+Match=20a=20single=20character=20from=20= one=20of=20the=20@var{charset}s.=0A+Each=20@var{charset}=20is=20a=20= character,=20a=20string=20representing=20the=20set=20of=0A+its=20= characters,=20a=20range=20or=20a=20character=20class.=20=20A=20range=20= is=20either=20a=0A+hyphen-separated=20string=20like=20@code{"A-Z"},=20or=20= a=20cons=20of=20characters=0A+like=20@code{(?A=20.=20?Z)}.=0A+=0A+Note=20= that=20hyphen=20(@code{-})=20is=20special=20in=20strings=20in=20this=20= construct,=0A+since=20it=20acts=20as=20a=20range=20separator.=20=20To=20= include=20a=20hyphen,=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= @samp{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@samp{not-newline}=20in=20= rx=0A+@cindex=20@samp{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@samp{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=200--9.=0A+=0A+@item=20@code{xdigit},=20= @code{hex-digit},=20@code{hex}=0A+Match=200--9,=20A--F=20and=20a--f.=0A+=0A= +@item=20@code{cntrl},=20@code{control}=0A+Match=20any=20character=20= whose=20code=20is=20in=20the=20range=200--31.=0A+=0A+@item=20= @code{space},=20@code{whitespace},=20@code{white}=0A+Match=20any=20= character=20that=20has=20whitespace=20syntax.=0A+=0A+@item=20= @code{lower},=20@code{lower-case}=0A+Match=20anything=20lower-case,=20as=20= determined=20by=20the=20current=20case=20table.=0A+If=20= @code{case-fold-search}=20is=20non-nil,=20this=20also=20matches=20any=0A= +upper-case=20letter.=0A+=0A+@item=20@code{upper},=20@code{upper-case}=0A= +Match=20anything=20upper-case,=20as=20determined=20by=20the=20current=20= case=20table.=0A+If=20@code{case-fold-search}=20is=20non-nil,=20this=20= also=20matches=20any=0A+lower-case=20letter.=0A+=0A+@item=20= @code{graph},=20@code{graphic}=0A+Match=20any=20character=20except=20= whitespace,=20ASCII=20and=20non-ASCII=20control=0A+characters,=20= surrogates,=20and=20codepoints=20unassigned=20by=20Unicode,=20as=0A= +indicated=20by=20the=20Unicode=20@samp{general-category}=20property.=0A= +=0A+@item=20@code{print},=20@code{printing}=0A+Match=20whitespace=20or=20= a=20character=20matched=20by=20@code{graph}.=0A+=0A+@item=20= @code{punct},=20@code{punctuation}=0A+Match=20any=20punctuation=20= character.=20=20(At=20present,=20for=20multibyte=0A+characters,=20= anything=20that=20has=20non-word=20syntax.)=0A+=0A+@item=20@code{word},=20= @code{wordchar}=0A+Match=20any=20character=20that=20has=20word=20syntax=20= (@pxref{Syntax=20Class=20Table}).=0A+@end=20table=0A+=0A+Corresponding=20= string=20regexp:=20@samp{[[:@var{class}:]]}=0A+=0A+@item=20@code{(syntax=20= @var{syntax})}=0A+@cindex=20@samp{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= +@xref{Syntax=20Class=20Table}=20for=20details.=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@samp{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=20command=0A+@kbd{M-x=20describe-categories=20= @key{RET}}.=20=20@xref{Categories}=20for=20how=0A+to=20define=20new=20= categories.@*=0A+Corresponding=20string=20regexp:=20@samp{\c@var{code}}=0A= +@end=20table=0A+=0A+@subsubheading=20Zero-width=20assertions=0A+=0A= +These=20all=20match=20the=20empty=20string,=20but=20only=20in=20= specific=20places.=0A+=0A+@table=20@asis=0A+@item=20@code{line-start},=20= @code{bol}=0A+@cindex=20@samp{line-start}=20in=20rx=0A+@cindex=20= @samp{bol}=20in=20rx=0A+Match=20at=20the=20beginning=20of=20a=20line.@*=0A= +Corresponding=20string=20regexp:=20@samp{^}=0A+=0A+@item=20= @code{line-end},=20@code{eol}=0A+@cindex=20@samp{line-end}=20in=20rx=0A= +@cindex=20@samp{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@samp{string-start}=20in=20rx=0A+@cindex=20@samp{bos}=20in=20= rx=0A+@cindex=20@samp{buffer-start}=20in=20rx=0A+@cindex=20@samp{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@samp{string-end}=20in=20rx=0A= +@cindex=20@samp{eos}=20in=20rx=0A+@cindex=20@samp{buffer-end}=20in=20rx=0A= +@cindex=20@samp{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= @samp{point}=20in=20rx=0A+Matches=20at=20point.@*=0A+Corresponding=20= string=20regexp:=20@samp{\=3D}=0A+=0A+@item=20@code{word-start}=0A= +@cindex=20@samp{word-start}=20in=20rx=0A+Matches=20at=20the=20beginning=20= of=20a=20word.@*=0A+Corresponding=20string=20regexp:=20@samp{\<}=0A+=0A= +@item=20@code{word-end}=0A+@cindex=20@samp{word-end}=20in=20rx=0A= +Matches=20at=20the=20end=20of=20a=20word.@*=0A+Corresponding=20string=20= regexp:=20@samp{\>}=0A+=0A+@item=20@code{word-boundary}=0A+@cindex=20= @samp{word-boundary}=20in=20rx=0A+Matches=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= @samp{not-word-boundary}=20in=20rx=0A+Matches=20anywhere=20but=20at=20= the=20beginning=20or=20end=20of=20a=20word.@*=0A+Corresponding=20string=20= regexp:=20@samp{\B}=0A+=0A+@item=20@code{symbol-start}=0A+@cindex=20= @samp{symbol-start}=20in=20rx=0A+Matches=20at=20the=20beginning=20of=20a=20= symbol.@*=0A+Corresponding=20string=20regexp:=20@samp{\_<}=0A+=0A+@item=20= @code{symbol-end}=0A+@cindex=20@samp{symbol-end}=20in=20rx=0A+Matches=20= at=20the=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= @samp{group}=20in=20rx=0A+@itemx=20(submatch=20@var{rx}@dots{})=0A= +@cindex=20@samp{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@samp{group-n}=20in=20rx=0A+@itemx=20(submatch-n=20@var{n}=20= @var{rx}@dots{})=0A+@cindex=20@samp{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@samp{backref}=20in=20rx=0A+Match=20the=20text=20previously=20= matched=20by=20group=20number=20@var{n}.=0A+@var{n}=20must=20be=20= positive=20and=20less=20than=2010.@*=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@samp{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@samp{regexp}=20in=20rx=0A+@itemx=20(regex=20= @var{expr})=0A+@cindex=20@samp{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@samp{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{pcase=20Macro}.=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=_E9E5D2A6-19E7-48F8-AEEE-166FC0867929--