/usr/share/doc/racket/reference/regexp.html is in racket-doc 6.7-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>4.7 Regular Expressions</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="extras.css" title="default"/><link rel="stylesheet" type="text/css" href="icons.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">►</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x"><span style="font-weight: bold">The Racket Reference</span></a></td></tr></table></div><div class="tocviewsublisttop" style="display: none;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="model.html" class="tocviewlink" data-pltdoc="x">Language Model</a></td></tr><tr><td align="right">2 </td><td><a href="notation.html" class="tocviewlink" data-pltdoc="x">Notation for Documentation</a></td></tr><tr><td align="right">3 </td><td><a href="syntax.html" class="tocviewlink" data-pltdoc="x">Syntactic Forms</a></td></tr><tr><td align="right">4 </td><td><a href="data.html" class="tocviewselflink" data-pltdoc="x">Datatypes</a></td></tr><tr><td align="right">5 </td><td><a href="structures.html" class="tocviewlink" data-pltdoc="x">Structures</a></td></tr><tr><td align="right">6 </td><td><a href="mzlib_class.html" class="tocviewlink" data-pltdoc="x">Classes and Objects</a></td></tr><tr><td align="right">7 </td><td><a href="mzlib_unit.html" class="tocviewlink" data-pltdoc="x">Units</a></td></tr><tr><td align="right">8 </td><td><a href="contracts.html" class="tocviewlink" data-pltdoc="x">Contracts</a></td></tr><tr><td align="right">9 </td><td><a href="match.html" class="tocviewlink" data-pltdoc="x">Pattern Matching</a></td></tr><tr><td align="right">10 </td><td><a href="control.html" class="tocviewlink" data-pltdoc="x">Control Flow</a></td></tr><tr><td align="right">11 </td><td><a href="concurrency.html" class="tocviewlink" data-pltdoc="x">Concurrency and Parallelism</a></td></tr><tr><td align="right">12 </td><td><a href="Macros.html" class="tocviewlink" data-pltdoc="x">Macros</a></td></tr><tr><td align="right">13 </td><td><a href="input-and-output.html" class="tocviewlink" data-pltdoc="x">Input and Output</a></td></tr><tr><td align="right">14 </td><td><a href="security.html" class="tocviewlink" data-pltdoc="x">Reflection and Security</a></td></tr><tr><td align="right">15 </td><td><a href="os.html" class="tocviewlink" data-pltdoc="x">Operating System</a></td></tr><tr><td align="right">16 </td><td><a href="memory.html" class="tocviewlink" data-pltdoc="x">Memory Management</a></td></tr><tr><td align="right">17 </td><td><a href="unsafe.html" class="tocviewlink" data-pltdoc="x">Unsafe Operations</a></td></tr><tr><td align="right">18 </td><td><a href="running.html" class="tocviewlink" data-pltdoc="x">Running Racket</a></td></tr><tr><td align="right"></td><td><a href="doc-bibliography.html" class="tocviewlink" data-pltdoc="x">Bibliography</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">▼</a></td><td>4 </td><td><a href="data.html" class="tocviewlink" data-pltdoc="x">Datatypes</a></td></tr></table><div class="tocviewsublist" style="display: block;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">4.1 </td><td><a href="booleans.html" class="tocviewlink" data-pltdoc="x">Booleans and Equality</a></td></tr><tr><td align="right">4.2 </td><td><a href="numbers.html" class="tocviewlink" data-pltdoc="x">Numbers</a></td></tr><tr><td align="right">4.3 </td><td><a href="strings.html" class="tocviewlink" data-pltdoc="x">Strings</a></td></tr><tr><td align="right">4.4 </td><td><a href="bytestrings.html" class="tocviewlink" data-pltdoc="x">Byte Strings</a></td></tr><tr><td align="right">4.5 </td><td><a href="characters.html" class="tocviewlink" data-pltdoc="x">Characters</a></td></tr><tr><td align="right">4.6 </td><td><a href="symbols.html" class="tocviewlink" data-pltdoc="x">Symbols</a></td></tr><tr><td align="right">4.7 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Regular Expressions</a></td></tr><tr><td align="right">4.8 </td><td><a href="keywords.html" class="tocviewlink" data-pltdoc="x">Keywords</a></td></tr><tr><td align="right">4.9 </td><td><a href="pairs.html" class="tocviewlink" data-pltdoc="x">Pairs and Lists</a></td></tr><tr><td align="right">4.10 </td><td><a href="mpairs.html" class="tocviewlink" data-pltdoc="x">Mutable Pairs and Lists</a></td></tr><tr><td align="right">4.11 </td><td><a href="vectors.html" class="tocviewlink" data-pltdoc="x">Vectors</a></td></tr><tr><td align="right">4.12 </td><td><a href="boxes.html" class="tocviewlink" data-pltdoc="x">Boxes</a></td></tr><tr><td align="right">4.13 </td><td><a href="hashtables.html" class="tocviewlink" data-pltdoc="x">Hash Tables</a></td></tr><tr><td align="right">4.14 </td><td><a href="sequences_streams.html" class="tocviewlink" data-pltdoc="x">Sequences and Streams</a></td></tr><tr><td align="right">4.15 </td><td><a href="dicts.html" class="tocviewlink" data-pltdoc="x">Dictionaries</a></td></tr><tr><td align="right">4.16 </td><td><a href="sets.html" class="tocviewlink" data-pltdoc="x">Sets</a></td></tr><tr><td align="right">4.17 </td><td><a href="procedures.html" class="tocviewlink" data-pltdoc="x">Procedures</a></td></tr><tr><td align="right">4.18 </td><td><a href="void.html" class="tocviewlink" data-pltdoc="x">Void</a></td></tr><tr><td align="right">4.19 </td><td><a href="undefined.html" class="tocviewlink" data-pltdoc="x">Undefined</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_2");">►</a></td><td>4.7 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Regular Expressions</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_2"><table cellspacing="0" cellpadding="0"><tr><td align="right">4.7.1 </td><td><a href="#%28part._regexp-syntax%29" class="tocviewlink" data-pltdoc="x">Regexp Syntax</a></td></tr><tr><td align="right">4.7.2 </td><td><a href="#%28part._.Additional_.Syntactic_.Constraints%29" class="tocviewlink" data-pltdoc="x">Additional Syntactic Constraints</a></td></tr><tr><td align="right">4.7.3 </td><td><a href="#%28part._.Regexp_.Constructors%29" class="tocviewlink" data-pltdoc="x">Regexp Constructors</a></td></tr><tr><td align="right">4.7.4 </td><td><a href="#%28part._.Regexp_.Matching%29" class="tocviewlink" data-pltdoc="x">Regexp Matching</a></td></tr><tr><td align="right">4.7.5 </td><td><a href="#%28part._.Regexp_.Splitting%29" class="tocviewlink" data-pltdoc="x">Regexp Splitting</a></td></tr><tr><td align="right">4.7.6 </td><td><a href="#%28part._.Regexp_.Substitution%29" class="tocviewlink" data-pltdoc="x">Regexp Substitution</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">4.7.1<tt> </tt></span><a href="#%28part._regexp-syntax%29" class="tocsubseclink" data-pltdoc="x">Regexp Syntax</a></td></tr><tr><td><span class="tocsublinknumber">4.7.2<tt> </tt></span><a href="#%28part._.Additional_.Syntactic_.Constraints%29" class="tocsubseclink" data-pltdoc="x">Additional Syntactic Constraints</a></td></tr><tr><td><span class="tocsublinknumber">4.7.3<tt> </tt></span><a href="#%28part._.Regexp_.Constructors%29" class="tocsubseclink" data-pltdoc="x">Regexp Constructors</a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._pregexp~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">pregexp?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">byte-<wbr></wbr>regexp?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._byte-pregexp~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">byte-<wbr></wbr>pregexp?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._pregexp%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">pregexp</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">byte-<wbr></wbr>regexp</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._byte-pregexp%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">byte-<wbr></wbr>pregexp</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-quote%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>quote</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-max-lookbehind%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>max-<wbr></wbr>lookbehind</span></span></a></td></tr><tr><td><span class="tocsublinknumber">4.7.4<tt> </tt></span><a href="#%28part._.Regexp_.Matching%29" class="tocsubseclink" data-pltdoc="x">Regexp Matching</a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match%2A%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match*</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-try-match%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>try-<wbr></wbr>match</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-positions%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match-<wbr></wbr>positions</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match-positions%2A%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match-<wbr></wbr>positions*</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match-exact~3f%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match-<wbr></wbr>exact?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match-<wbr></wbr>peek</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek-positions%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match-<wbr></wbr>peek-<wbr></wbr>positions</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek-immediate%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match-<wbr></wbr>peek-<wbr></wbr>immediate</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek-positions-immediate%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match-<wbr></wbr>peek-<wbr></wbr>positions-<wbr></wbr>immediate</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match-peek-positions%2A%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match-<wbr></wbr>peek-<wbr></wbr>positions*</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%2Fend%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match/<span class="mywbr"> </span>end</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-positions%2Fend%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match-<wbr></wbr>positions/<span class="mywbr"> </span>end</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek-positions%2Fend%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match-<wbr></wbr>peek-<wbr></wbr>positions/<span class="mywbr"> </span>end</span></span></a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek-positions-immediate%2Fend%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>match-<wbr></wbr>peek-<wbr></wbr>positions-<wbr></wbr>immediate/<span class="mywbr"> </span>end</span></span></a></td></tr><tr><td><span class="tocsublinknumber">4.7.5<tt> </tt></span><a href="#%28part._.Regexp_.Splitting%29" class="tocsubseclink" data-pltdoc="x">Regexp Splitting</a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-split%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>split</span></span></a></td></tr><tr><td><span class="tocsublinknumber">4.7.6<tt> </tt></span><a href="#%28part._.Regexp_.Substitution%29" class="tocsubseclink" data-pltdoc="x">Regexp Substitution</a></td></tr><tr><td><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-replace%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>replace</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replace%2A%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>replace*</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replaces%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>replaces</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replace-quote%29%29" class="tocsubnonseclink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">regexp-<wbr></wbr>replace-<wbr></wbr>quote</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="symbols.html" title="backward to "4.6 Symbols"" data-pltdoc="x">← prev</a> <a href="data.html" title="up to "4 Datatypes"" data-pltdoc="x">up</a> <a href="keywords.html" title="forward to "4.8 Keywords"" data-pltdoc="x">next →</a></span> </div><h4 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-source-pkg="racket-doc" x-part-tag=""regexp"">4.7<tt> </tt><a name="(part._regexp)"></a><a name="(idx._(gentag._160._(lib._scribblings/reference/reference..scrbl)))"></a><a name="(idx._(gentag._161._(lib._scribblings/reference/reference..scrbl)))"></a><a name="(idx._(gentag._162._(lib._scribblings/reference/reference..scrbl)))"></a><a name="(idx._(gentag._163._(lib._scribblings/reference/reference..scrbl)))"></a>Regular Expressions</h4><blockquote class="refpara"><blockquote class="refcolumn"><blockquote class="refcontent"><p><span class="imageleft"><img src="finger.png" alt="+" width="24" height="24"/></span><a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=regexp.html&version=6.7" class="Sq" data-pltdoc="x">Regular Expressions</a> in <a href="https://download.racket-lang.org/docs/6.7/html/local-redirect/index.html?doc=guide&rel=index.html&version=6.7" class="Sq" data-pltdoc="x"><span style="font-weight: bold">The Racket Guide</span></a> introduces regular expressions.</p></blockquote></blockquote></blockquote><p><a name="(tech._regular._expression)"></a><span style="font-style: italic">Regular expressions</span> are specified as strings or byte
strings, using the same pattern language as either the Unix utility
<span class="stt">egrep</span> or Perl. A string-specified pattern produces a character
regexp matcher, and a byte-string pattern produces a byte regexp
matcher. If a character regexp is used with a byte string or input
port, it matches UTF-8 encodings (see <a href="encodings.html" data-pltdoc="x">Encodings and Locales</a>) of
matching character streams; if a byte regexp is used with a character
string, it matches bytes in the UTF-8 encoding of the string.</p><p>A regular expression that is represented as a string or byte string
can be compiled to a <a name="(tech._regexp._value)"></a><span style="font-style: italic">regexp value</span>, which can be used more
efficiently by functions such as <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span> compared to the
string or byte string form. The <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp%29%29" class="RktValLink" data-pltdoc="x">regexp</a></span> and
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp%29%29" class="RktValLink" data-pltdoc="x">byte-regexp</a></span> procedures convert a string or byte string
(respectively) into a regexp value using a syntax of regular
expressions that is most compatible to <span class="stt">egrep</span>. The
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._pregexp%29%29" class="RktValLink" data-pltdoc="x">pregexp</a></span> and <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-pregexp%29%29" class="RktValLink" data-pltdoc="x">byte-pregexp</a></span> procedures produce a regexp
value using a slightly different syntax of regular expressions that is
more compatible with Perl.</p><p>Two <a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp values</span></a> are <span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._equal~3f%29%29" class="RktValLink" data-pltdoc="x">equal?</a></span> if they have the same
source, use the same pattern language, and are both character regexps
or both byte regexps.</p><p>A literal or printed <a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp value</span></a> starts with <span class="RktInBG"><span class="hspace"></span><span class="RktIn">#rx</span><span class="hspace"></span></span> or
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">#px</span><span class="hspace"></span></span>. See <a href="reader.html#%28part._parse-regexp%29" data-pltdoc="x">Reading Regular Expressions</a>
for information on <span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read%29%29" class="RktValLink" data-pltdoc="x">read</a></span>ing
regular expressions and <a href="printing.html#%28part._print-regexp%29" data-pltdoc="x">Printing Regular Expressions</a>
for information on <span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._print%29%29" class="RktValLink" data-pltdoc="x">print</a></span>ing regular expressions. Regexp
values produced by the default reader are <a href="reader.html#%28tech._interned%29" class="techoutside" data-pltdoc="x"><span class="techinside">interned</span></a> in
<span class="RktSym"><a href="Reading.html#%28def._%28%28quote._~23~25kernel%29._read-syntax%29%29" class="RktValLink" data-pltdoc="x">read-syntax</a></span> mode.</p><p>The internal size of a <a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp value</span></a> is limited to 32 kilobytes; this
limit roughly corresponds to a source string with 32,000 literal
characters or 5,000 operators.</p><h5 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-source-pkg="racket-doc" x-part-tag=""regexp-syntax"">4.7.1<tt> </tt><a name="(part._regexp-syntax)"></a>Regexp Syntax</h5><p>The following syntax specifications describe the content of a string
that represents a regular expression. The syntax of the corresponding
string may involve extra escape characters. For example, the regular
expression <span class="RktInBG"><span class="hspace"></span><span class="RktIn">(.*)\1</span><span class="hspace"></span></span> can be represented with the string
<span class="RktVal">"(.*)\\1"</span> or the regexp constant <span class="RktVal">#rx"(.*)\\1"</span>; the
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span> in the regular expression must be escaped to include it
in a string or regexp constant.</p><p>The <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp%29%29" class="RktValLink" data-pltdoc="x">regexp</a></span> and <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._pregexp%29%29" class="RktValLink" data-pltdoc="x">pregexp</a></span> syntaxes share a common core:</p><p><table cellspacing="0" cellpadding="0"><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">pces</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">pces</span>›</span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match either <span class="sroman">‹<span style="font-style: italic">regexp</span>›</span>, try left first</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._1%29%29" data-pltdoc="x">ex1</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">pces</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">pce</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">pce</span>›</span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">pce</span>›</span><span class="sroman">‹<span style="font-style: italic">pces</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">pce</span>›</span> followed by <span class="sroman">‹<span style="font-style: italic">pces</span>›</span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">pce</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">repeat</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">repeat</span>›</span>, longest possible</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._3%29%29" data-pltdoc="x">ex3</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">repeat</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">repeat</span>›</span>, shortest possible</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._6%29%29" data-pltdoc="x">ex6</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">atom</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">atom</span>›</span> exactly once</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">repeat</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">*</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">atom</span>›</span> 0 or more times</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._3%29%29" data-pltdoc="x">ex3</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">+</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">atom</span>›</span> 1 or more times</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._4%29%29" data-pltdoc="x">ex4</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">atom</span>›</span> 0 or 1 times</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._5%29%29" data-pltdoc="x">ex5</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">atom</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match sub-expression <span class="sroman">‹<span style="font-style: italic">regexp</span>›</span> and report</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._11%29%29" data-pltdoc="x">ex11</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">rng</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match any character in <span class="sroman">‹<span style="font-style: italic">rng</span>›</span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._2%29%29" data-pltdoc="x">ex2</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[^</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">rng</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match any character not in <span class="sroman">‹<span style="font-style: italic">rng</span>›</span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._12%29%29" data-pltdoc="x">ex12</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">.</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match any (except newline in multi mode)</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._13%29%29" data-pltdoc="x">ex13</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match start (or after newline in multi mode)</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._14%29%29" data-pltdoc="x">ex14</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">$</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match end (or before newline in multi mode)</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._15%29%29" data-pltdoc="x">ex15</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">literal</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match a single literal character</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._1%29%29" data-pltdoc="x">ex1</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">mode</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">:</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">regexp</span>›</span> using <span class="sroman">‹<span style="font-style: italic">mode</span>›</span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._35%29%29" data-pltdoc="x">ex35</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?></span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">regexp</span>›</span>, only first possible</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">look</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match empty if <span class="sroman">‹<span style="font-style: italic">look</span>›</span> matches</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">tst</span>›</span><span class="sroman">‹<span style="font-style: italic">pces</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">pces</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match 1st <span class="sroman">‹<span style="font-style: italic">pces</span>›</span> if <span class="sroman">‹<span style="font-style: italic">tst</span>›</span>, else 2nd <span class="sroman">‹<span style="font-style: italic">pces</span>›</span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._36%29%29" data-pltdoc="x">ex36</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">tst</span>›</span><span class="sroman">‹<span style="font-style: italic">pces</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">pces</span>›</span> if <span class="sroman">‹<span style="font-style: italic">tst</span>›</span>, empty if not <span class="sroman">‹<span style="font-style: italic">tst</span>›</span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">rng</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">rng</span>›</span> contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> only</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._27%29%29" data-pltdoc="x">ex27</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">rng</span>›</span> contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span> only</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._28%29%29" data-pltdoc="x">ex28</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">mrng</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">rng</span>›</span> contains everything in <span class="sroman">‹<span style="font-style: italic">mrng</span>›</span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">mrng</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">rng</span>›</span> contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span> and everything in <span class="sroman">‹<span style="font-style: italic">mrng</span>›</span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">mrng</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">lrng</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">mrng</span>›</span> contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> and everything in <span class="sroman">‹<span style="font-style: italic">lrng</span>›</span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._29%29%29" data-pltdoc="x">ex29</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">lrng</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">mrng</span>›</span> contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span> and everything in <span class="sroman">‹<span style="font-style: italic">lrng</span>›</span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._29%29%29" data-pltdoc="x">ex29</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">lirng</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">mrng</span>›</span> contains everything in <span class="sroman">‹<span style="font-style: italic">lirng</span>›</span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">lirng</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">riliteral</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">lirng</span>›</span> contains a literal character</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">riliteral</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">rliteral</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">lirng</span>›</span> contains Unicode range inclusive</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._22%29%29" data-pltdoc="x">ex22</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">lirng</span>›</span><span class="sroman">‹<span style="font-style: italic">lrng</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">lirng</span>›</span> contains everything in both</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">lrng</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">lrng</span>›</span> contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._30%29%29" data-pltdoc="x">ex30</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">rliteral</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">rliteral</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">lrng</span>›</span> contains Unicode range inclusive</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">lrng</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">lrng</span>›</span> contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span> and more</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">lirng</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">lrng</span>›</span> contains everything in <span class="sroman">‹<span style="font-style: italic">lirng</span>›</span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">look</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?=</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match if <span class="sroman">‹<span style="font-style: italic">regexp</span>›</span> matches</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._31%29%29" data-pltdoc="x">ex31</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?!</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match if <span class="sroman">‹<span style="font-style: italic">regexp</span>›</span> doesn't match</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._32%29%29" data-pltdoc="x">ex32</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?<=</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match if <span class="sroman">‹<span style="font-style: italic">regexp</span>›</span> matches preceding</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._33%29%29" data-pltdoc="x">ex33</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?<!</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match if <span class="sroman">‹<span style="font-style: italic">regexp</span>›</span> doesn't match preceding</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._34%29%29" data-pltdoc="x">ex34</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">tst</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">n</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">True if Nth <span class="RktInBG"><span class="hspace"></span><span class="RktIn">(</span><span class="hspace"></span></span> has a match</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">look</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">True if <span class="sroman">‹<span style="font-style: italic">look</span>›</span> matches</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._36%29%29" data-pltdoc="x">ex36</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">mode</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Like the enclosing mode</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">mode</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">i</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Like <span class="sroman">‹<span style="font-style: italic">mode</span>›</span>, but case-insensitive</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._35%29%29" data-pltdoc="x">ex35</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">mode</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">-i</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Like <span class="sroman">‹<span style="font-style: italic">mode</span>›</span>, but sensitive</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">mode</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">s</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Like <span class="sroman">‹<span style="font-style: italic">mode</span>›</span>, but not in multi mode</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">mode</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">-s</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Like <span class="sroman">‹<span style="font-style: italic">mode</span>›</span>, but in multi mode</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">mode</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">m</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Like <span class="sroman">‹<span style="font-style: italic">mode</span>›</span>, but in multi mode</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">mode</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">-m</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Like <span class="sroman">‹<span style="font-style: italic">mode</span>›</span>, but not in multi mode</span></p></td><td align="left"><p></p></td></tr></table></p><p>The following completes the grammar for <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp%29%29" class="RktValLink" data-pltdoc="x">regexp</a></span>, which treats
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span> and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span> as literals, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span> as a
literal within ranges, and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span> as a literal producer
outside of ranges.</p><p><table cellspacing="0" cellpadding="0"><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">literal</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left" colspan="3"><p>Any character except <span class="RktInBG"><span class="hspace"></span><span class="RktIn">(</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">*</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">+</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">.</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span>, or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">aliteral</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">aliteral</span>›</span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._21%29%29" data-pltdoc="x">ex21</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">aliteral</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left" colspan="3"><p>Any character</p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">riliteral</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left" colspan="3"><p>Any character except <span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span>, or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">rliteral</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left" colspan="3"><p>Any character except <span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span> or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span></p></td><td align="left"><p></p></td></tr></table></p><p>The following completes the grammar for <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._pregexp%29%29" class="RktValLink" data-pltdoc="x">pregexp</a></span>, which uses
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span> and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span> bounded repetition and uses
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span> for meta-characters both inside and outside of ranges.</p><p><table cellspacing="0" cellpadding="0"><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">repeat</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p>...</p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">...</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">n</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">atom</span>›</span> exactly <span class="sroman">‹<span style="font-style: italic">n</span>›</span> times</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._7%29%29" data-pltdoc="x">ex7</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">n</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,}</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">atom</span>›</span> <span class="sroman">‹<span style="font-style: italic">n</span>›</span> or more times</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._8%29%29" data-pltdoc="x">ex8</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">{,</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">m</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">atom</span>›</span> between 0 and <span class="sroman">‹<span style="font-style: italic">m</span>›</span> times</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._9%29%29" data-pltdoc="x">ex9</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">n</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">m</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">atom</span>›</span> between <span class="sroman">‹<span style="font-style: italic">n</span>›</span> and <span class="sroman">‹<span style="font-style: italic">m</span>›</span> times</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._10%29%29" data-pltdoc="x">ex10</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">atom</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p>...</p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">...</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">n</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match latest reported match for <span class="sroman">‹<span style="font-style: italic">n</span>›</span>th <span class="RktInBG"><span class="hspace"></span><span class="RktIn">(</span><span class="hspace"></span></span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._16%29%29" data-pltdoc="x">ex16</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">class</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match any character in <span class="sroman">‹<span style="font-style: italic">class</span>›</span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\b</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\w*</span><span class="hspace"></span></span> boundary</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._17%29%29" data-pltdoc="x">ex17</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\B</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match where <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\b</span><span class="hspace"></span></span> does not</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._18%29%29" data-pltdoc="x">ex18</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\p{</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">property</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match (UTF-8 encoded) in <span class="sroman">‹<span style="font-style: italic">property</span>›</span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._19%29%29" data-pltdoc="x">ex19</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\P{</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">property</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match (UTF-8 encoded) not in <span class="sroman">‹<span style="font-style: italic">property</span>›</span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._20%29%29" data-pltdoc="x">ex20</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">literal</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left" colspan="3"><p>Any character except <span class="RktInBG"><span class="hspace"></span><span class="RktIn">(</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">*</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">+</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">.</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span>, or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">aliteral</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Match <span class="sroman">‹<span style="font-style: italic">aliteral</span>›</span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._21%29%29" data-pltdoc="x">ex21</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">aliteral</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left" colspan="3"><p>Any character except <span class="RktInBG"><span class="hspace"></span><span class="RktIn">a</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">z</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">A</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">Z</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">0</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">9</span><span class="hspace"></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">lirng</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p>...</p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">...</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">class</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">lirng</span>›</span> contains all characters in <span class="sroman">‹<span style="font-style: italic">class</span>›</span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">posix</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">lirng</span>›</span> contains all characters in <span class="sroman">‹<span style="font-style: italic">posix</span>›</span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._26%29%29" data-pltdoc="x">ex26</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">eliteral</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller"><span class="sroman">‹<span style="font-style: italic">lirng</span>›</span> contains <span class="sroman">‹<span style="font-style: italic">eliteral</span>›</span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">riliteral</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left" colspan="3"><p>Any character except <span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span>, or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">rliteral</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left" colspan="3"><p>Any character except <span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span>, or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">-</span><span class="hspace"></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">eliteral</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left" colspan="3"><p>Any character except <span class="RktInBG"><span class="hspace"></span><span class="RktIn">a</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">z</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">A</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">Z</span><span class="hspace"></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">class</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\d</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">0</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">9</span><span class="hspace"></span></span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._23%29%29" data-pltdoc="x">ex23</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\D</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains ASCII other than those in <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\d</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\w</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">a</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">z</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">A</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">Z</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">0</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">9</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">_</span><span class="hspace"></span></span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._24%29%29" data-pltdoc="x">ex24</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\W</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains ASCII other than those in <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\w</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\s</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains space, tab, newline, formfeed, return</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._25%29%29" data-pltdoc="x">ex25</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\S</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains ASCII other than those in <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\s</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">posix</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[:alpha:]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">a</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">z</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">A</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">Z</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[:upper:]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">A</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">Z</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[:lower:]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">a</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">z</span><span class="hspace"></span></span></span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._26%29%29" data-pltdoc="x">ex26</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[:digit:]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">0</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">9</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[:xdigit:]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">0</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">9</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">a</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">f</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">A</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">F</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[:alnum:]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">a</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">z</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">A</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">Z</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">0</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">9</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[:word:]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">a</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">z</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">A</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">Z</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">0</span><span class="hspace"></span></span>-<span class="RktInBG"><span class="hspace"></span><span class="RktIn">9</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">_</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[:blank:]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains space and tab</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[:space:]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains space, tab, newline, formfeed, return</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[:graph:]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains all ASCII characters that use ink</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[:print:]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains space, tab, and ASCII ink users</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[:cntrl:]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains all characters with scalar value < 32</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[:ascii:]</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Contains all ASCII characters</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">property</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">category</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Includes all characters in <span class="sroman">‹<span style="font-style: italic">category</span>›</span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">category</span>›</span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Includes all characters not in <span class="sroman">‹<span style="font-style: italic">category</span>›</span></span></p></td><td align="left"><p></p></td></tr></table></p><p>The Unicode categories follow.</p><p><table cellspacing="0" cellpadding="0"><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="sroman">‹<span style="font-style: italic">category</span>›</span></p></td><td align="center"><p><span class="hspace"> </span><span class="stt">::=</span><span class="hspace"> </span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Ll</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Letter, lowercase</span></p></td><td align="left"><p><span class="Smaller"> <a href="#%28elem._%28rxex._19%29%29" data-pltdoc="x">ex19</a></span></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Lu</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Letter, uppercase</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Lt</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Letter, titlecase</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Lm</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Letter, modifier</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">L&</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Union of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Ll</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Lu</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Lt</span><span class="hspace"></span></span>, and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Lm</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Lo</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Letter, other</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">L</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Union of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">L&</span><span class="hspace"></span></span> and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Lo</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Nd</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Number, decimal digit</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Nl</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Number, letter</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">No</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Number, other</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">N</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Union of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Nd</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Nl</span><span class="hspace"></span></span>, and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">No</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Ps</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Punctuation, open</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Pe</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Punctuation, close</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Pi</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Punctuation, initial quote</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Pf</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Punctuation, final quote</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Pc</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Punctuation, connector</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Pd</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Punctuation, dash</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Po</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Punctuation, other</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">P</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Union of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Ps</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Pe</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Pi</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Pf</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Pc</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Pd</span><span class="hspace"></span></span>, and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Po</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Mn</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Mark, non-spacing</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Mc</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Mark, spacing combining</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Me</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Mark, enclosing</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">M</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Union of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Mn</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Mc</span><span class="hspace"></span></span>, and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Me</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Sc</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Symbol, currency</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Sk</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Symbol, modifier</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Sm</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Symbol, math</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">So</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Symbol, other</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">S</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Union of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Sc</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Sk</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Sm</span><span class="hspace"></span></span>, and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">So</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Zl</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Separator, line</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Zp</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Separator, paragraph</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Zs</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Separator, space</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Z</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Union of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Zl</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Zp</span><span class="hspace"></span></span>, and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Zs</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Cc</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Other, control</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Cf</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Other, format</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Cs</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Other, surrogate</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Cn</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Other, not assigned</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">Co</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Other, private use</span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">C</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Union of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Cc</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Cf</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Cs</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Cn</span><span class="hspace"></span></span>, and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">Co</span><span class="hspace"></span></span></span></p></td><td align="left"><p></p></td></tr><tr><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p> </p></td><td align="center"><p><span class="stt">|</span></p></td><td align="left"><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">.</span><span class="hspace"></span></span></p></td><td align="left"><p><span class="hspace"> </span></p></td><td align="left"><p><span class="smaller">Union of all Unicode categories</span></p></td><td align="left"><p></p></td></tr></table></p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"a|b"</span><span class="stt"> </span><span class="RktVal">"cat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._1))"></a><span class="RktCmt">1</span></td></tr><tr><td><p><span class="RktRes">'("a")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"[at]"</span><span class="stt"> </span><span class="RktVal">"cat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._2))"></a><span class="RktCmt">2</span></td></tr><tr><td><p><span class="RktRes">'("a")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"ca*[at]"</span><span class="stt"> </span><span class="RktVal">"caaat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._3))"></a><span class="RktCmt">3</span></td></tr><tr><td><p><span class="RktRes">'("caaat")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"ca+[at]"</span><span class="stt"> </span><span class="RktVal">"caaat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._4))"></a><span class="RktCmt">4</span></td></tr><tr><td><p><span class="RktRes">'("caaat")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"ca?t?"</span><span class="stt"> </span><span class="RktVal">"ct"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._5))"></a><span class="RktCmt">5</span></td></tr><tr><td><p><span class="RktRes">'("ct")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"ca*?[at]"</span><span class="stt"> </span><span class="RktVal">"caaat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._6))"></a><span class="RktCmt">6</span></td></tr><tr><td><p><span class="RktRes">'("ca")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#px"ca{2}"</span><span class="stt"> </span><span class="RktVal">"caaat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._7))"></a><span class="RktCmt">7</span><span class="RktCmt">, uses </span><span class="RktMeta">#px</span></td></tr><tr><td><p><span class="RktRes">'("caa")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#px"ca{2,}t"</span><span class="stt"> </span><span class="RktVal">"catcaat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._8))"></a><span class="RktCmt">8</span><span class="RktCmt">, uses </span><span class="RktMeta">#px</span></td></tr><tr><td><p><span class="RktRes">'("caat")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#px"ca{,2}t"</span><span class="stt"> </span><span class="RktVal">"caaatcat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._9))"></a><span class="RktCmt">9</span><span class="RktCmt">, uses </span><span class="RktMeta">#px</span></td></tr><tr><td><p><span class="RktRes">'("cat")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#px"ca{1,2}t"</span><span class="stt"> </span><span class="RktVal">"caaatcat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._10))"></a><span class="RktCmt">10</span><span class="RktCmt">, uses </span><span class="RktMeta">#px</span></td></tr><tr><td><p><span class="RktRes">'("cat")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"(c*)(a*)"</span><span class="stt"> </span><span class="RktVal">"caat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._11))"></a><span class="RktCmt">11</span></td></tr><tr><td><p><span class="RktRes">'("caa" "c" "aa")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"[^ca]"</span><span class="stt"> </span><span class="RktVal">"caat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._12))"></a><span class="RktCmt">12</span></td></tr><tr><td><p><span class="RktRes">'("t")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx".(.)."</span><span class="stt"> </span><span class="RktVal">"cat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._13))"></a><span class="RktCmt">13</span></td></tr><tr><td><p><span class="RktRes">'("cat" "a")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"^a|^c"</span><span class="stt"> </span><span class="RktVal">"cat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._14))"></a><span class="RktCmt">14</span></td></tr><tr><td><p><span class="RktRes">'("c")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"a$|t$"</span><span class="stt"> </span><span class="RktVal">"cat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._15))"></a><span class="RktCmt">15</span></td></tr><tr><td><p><span class="RktRes">'("t")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#px"c(.)\\1t"</span><span class="stt"> </span><span class="RktVal">"caat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._16))"></a><span class="RktCmt">16</span><span class="RktCmt">, uses </span><span class="RktMeta">#px</span></td></tr><tr><td><p><span class="RktRes">'("caat" "a")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#px".\\b."</span><span class="stt"> </span><span class="RktVal">"cat in hat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._17))"></a><span class="RktCmt">17</span><span class="RktCmt">, uses </span><span class="RktMeta">#px</span></td></tr><tr><td><p><span class="RktRes">'("t ")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#px".\\B."</span><span class="stt"> </span><span class="RktVal">"cat in hat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._18))"></a><span class="RktCmt">18</span><span class="RktCmt">, uses </span><span class="RktMeta">#px</span></td></tr><tr><td><p><span class="RktRes">'("ca")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#px"\\p{Ll}"</span><span class="stt"> </span><span class="RktVal">"Cat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._19))"></a><span class="RktCmt">19</span><span class="RktCmt">, uses </span><span class="RktMeta">#px</span></td></tr><tr><td><p><span class="RktRes">'("a")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#px"\\P{Ll}"</span><span class="stt"> </span><span class="RktVal">"cat!"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._20))"></a><span class="RktCmt">20</span><span class="RktCmt">, uses </span><span class="RktMeta">#px</span></td></tr><tr><td><p><span class="RktRes">'("!")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"\\|"</span><span class="stt"> </span><span class="RktVal">"c|t"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._21))"></a><span class="RktCmt">21</span></td></tr><tr><td><p><span class="RktRes">'("|")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"[a-f]*"</span><span class="stt"> </span><span class="RktVal">"cat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._22))"></a><span class="RktCmt">22</span></td></tr><tr><td><p><span class="RktRes">'("ca")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#px"[a-f\\d]*"</span><span class="stt"> </span><span class="RktVal">"1cat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._23))"></a><span class="RktCmt">23</span><span class="RktCmt">, uses </span><span class="RktMeta">#px</span></td></tr><tr><td><p><span class="RktRes">'("1ca")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#px" [\\w]"</span><span class="stt"> </span><span class="RktVal">"cat hat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._24))"></a><span class="RktCmt">24</span><span class="RktCmt">, uses </span><span class="RktMeta">#px</span></td></tr><tr><td><p><span class="RktRes">'(" h")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#px"t[\\s]"</span><span class="stt"> </span><span class="RktVal">"cat\nhat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._25))"></a><span class="RktCmt">25</span><span class="RktCmt">, uses </span><span class="RktMeta">#px</span></td></tr><tr><td><p><span class="RktRes">'("t\n")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#px"[[:lower:]]+"</span><span class="stt"> </span><span class="RktVal">"Cat"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._26))"></a><span class="RktCmt">26</span><span class="RktCmt">, uses </span><span class="RktMeta">#px</span></td></tr><tr><td><p><span class="RktRes">'("at")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"[]]"</span><span class="stt"> </span><span class="RktVal">"c]t"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._27))"></a><span class="RktCmt">27</span></td></tr><tr><td><p><span class="RktRes">'("]")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"[-]"</span><span class="stt"> </span><span class="RktVal">"c-t"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._28))"></a><span class="RktCmt">28</span></td></tr><tr><td><p><span class="RktRes">'("-")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"[]a[]+"</span><span class="stt"> </span><span class="RktVal">"c[a]t"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._29))"></a><span class="RktCmt">29</span></td></tr><tr><td><p><span class="RktRes">'("[a]")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"[a^]+"</span><span class="stt"> </span><span class="RktVal">"ca^t"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._30))"></a><span class="RktCmt">30</span></td></tr><tr><td><p><span class="RktRes">'("a^")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx".a(?=p)"</span><span class="stt"> </span><span class="RktVal">"cat nap"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._31))"></a><span class="RktCmt">31</span></td></tr><tr><td><p><span class="RktRes">'("na")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx".a(?!t)"</span><span class="stt"> </span><span class="RktVal">"cat nap"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._32))"></a><span class="RktCmt">32</span></td></tr><tr><td><p><span class="RktRes">'("na")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"(?<=n)a."</span><span class="stt"> </span><span class="RktVal">"cat nap"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._33))"></a><span class="RktCmt">33</span></td></tr><tr><td><p><span class="RktRes">'("ap")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"(?<!c)a."</span><span class="stt"> </span><span class="RktVal">"cat nap"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._34))"></a><span class="RktCmt">34</span></td></tr><tr><td><p><span class="RktRes">'("ap")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"(?i:a)[tp]"</span><span class="stt"> </span><span class="RktVal">"cAT nAp"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._35))"></a><span class="RktCmt">35</span></td></tr><tr><td><p><span class="RktRes">'("Ap")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="stt"> </span><span class="RktVal">#rx"(?(?<=c)a|b)+"</span><span class="stt"> </span><span class="RktVal">"cabal"</span><span class="RktPn">)</span><span class="stt"> </span><span class="RktCmt">;</span><span class="RktCmt"> </span><span class="RktCmt">ex</span><a name="(elem._(rxex._36))"></a><span class="RktCmt">36</span></td></tr><tr><td><p><span class="RktRes">'("ab")</span></p></td></tr></table></blockquote></div></p><h5 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-source-pkg="racket-doc" x-part-tag=""Additional_Syntactic_Constraints"">4.7.2<tt> </tt><a name="(part._.Additional_.Syntactic_.Constraints)"></a>Additional Syntactic Constraints</h5><p>In addition to matching a grammar, regular expressions must meet two
syntactic restrictions:</p><ul><li><p>In a <span class="sroman">‹<span style="font-style: italic">repeat</span>›</span> other than <span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span>,
the <span class="sroman">‹<span style="font-style: italic">atom</span>›</span> must not match an empty sequence.</p></li><li><p>In a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?<=</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span> or
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?<!</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span>,
the <span class="sroman">‹<span style="font-style: italic">regexp</span>›</span> must match a bounded sequence only.</p></li></ul><p>These constraints are checked syntactically by the following type
system. A type [<span style="font-style: italic">n</span>, <span style="font-style: italic">m</span>] corresponds to an expression that
matches between <span style="font-style: italic">n</span> and <span style="font-style: italic">m</span> characters. In the rule for
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">(</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">Regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span>, <span style="font-style: italic">N</span> means the number such
that the opening parenthesis is the <span style="font-style: italic">N</span>th opening parenthesis for
collecting match reports. Non-emptiness is inferred for a
backreference pattern, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">N</span>›</span>, so that a
backreference can be used for repetition patterns; in the case of
mutual dependencies among backreferences, the inference chooses the
fixpoint that maximizes non-emptiness. Finiteness is not inferred for
backreferences (i.e., a backreference is assumed to match an
arbitrarily large sequence).</p><p><table cellspacing="0" cellpadding="0"><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span></span><span style="vertical-align: sub; font-size: 80%">1</span><span class="RktInBG"><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">1</span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">1</span>]<span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span></span><span style="vertical-align: sub; font-size: 80%">2</span><span class="RktInBG"><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">2</span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">2</span>]<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span></span><span style="vertical-align: sub; font-size: 80%">1</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span></span><span style="vertical-align: sub; font-size: 80%">2</span><span class="RktInBG"><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[min(<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">1</span>, <span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">2</span>), max(<span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">1</span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">2</span>)]<span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">pce</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">1</span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">1</span>]<span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">pces</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">2</span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">2</span>]<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">pce</span>›</span><span class="sroman">‹<span style="font-style: italic">pces</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">1</span>+<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">2</span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">1</span>+<span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">2</span>]<span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">repeat</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">repeat</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[0, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span></p></td></tr></table></td><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span><span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span> > 0<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">*</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[0, ∞]<span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span><span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span> > 0<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">+</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[1, ∞]<span class="hspace"> </span></p></td></tr></table></td><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[0, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span><span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span> > 0<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">n</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>*<span class="sroman">‹<span style="font-style: italic">n</span>›</span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>*<span class="sroman">‹<span style="font-style: italic">n</span>›</span>]<span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span><span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span> > 0<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">n</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,}</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>*<span class="sroman">‹<span style="font-style: italic">n</span>›</span>, ∞]<span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span><span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span> > 0<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">{,</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">m</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[0, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>*<span class="sroman">‹<span style="font-style: italic">m</span>›</span>]<span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span><span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span> > 0<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">atom</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">{</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">n</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">,</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">m</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>*<span class="sroman">‹<span style="font-style: italic">n</span>›</span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>*<span class="sroman">‹<span style="font-style: italic">m</span>›</span>]<span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span>α<span style="vertical-align: sub; font-size: 80%">N</span>=<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span><span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">mode</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">:</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?=</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[0, 0]<span class="hspace"> </span></p></td></tr></table></td><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?!</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[0, 0]<span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span><span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span> < ∞<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?<=</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[0, 0]<span class="hspace"> </span></p></td></tr></table></td><td><p><span class="hspace"> </span></p></td><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span><span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span> < ∞<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?<!</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[0, 0]<span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?></span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">regexp</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%"></span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%"></span>]<span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">tst</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">0</span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">0</span>]<span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">pces</span>›</span><span class="RktInBG"><span class="hspace"></span></span><span style="vertical-align: sub; font-size: 80%">1</span><span class="RktInBG"><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">1</span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">1</span>]<span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">pces</span>›</span><span class="RktInBG"><span class="hspace"></span></span><span style="vertical-align: sub; font-size: 80%">2</span><span class="RktInBG"><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">2</span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">2</span>]<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">tst</span>›</span><span class="sroman">‹<span style="font-style: italic">pces</span>›</span><span class="RktInBG"><span class="hspace"></span></span><span style="vertical-align: sub; font-size: 80%">1</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">pces</span>›</span><span class="RktInBG"><span class="hspace"></span></span><span style="vertical-align: sub; font-size: 80%">2</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[min(<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">1</span>, <span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">2</span>), max(<span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">1</span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">2</span>)]<span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0"><tr><td align="center" class="inferencetop"><p><span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">tst</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">0</span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">0</span>]<span class="hspace"> </span><span class="sroman">‹<span style="font-style: italic">pces</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[<span style="font-style: italic">n</span><span style="vertical-align: sub; font-size: 80%">1</span>, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">1</span>]<span class="hspace"> </span></p></td></tr><tr><td align="center" class="inferencebottom"><p><span class="hspace"> </span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">tst</span>›</span><span class="sroman">‹<span style="font-style: italic">pces</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[0, <span style="font-style: italic">m</span><span style="vertical-align: sub; font-size: 80%">1</span>]<span class="hspace"> </span></p></td></tr></table></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">(</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">n</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">)</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[α<span style="vertical-align: sub; font-size: 80%">N</span>, ∞]</p></td><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">rng</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[1, 1]</p></td><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">[^</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">rng</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">]</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[1, 1]</p></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">.</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[1, 1]</p></td><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[0, 0]</p></td><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">$</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[0, 0]</p></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><p><span class="sroman">‹<span style="font-style: italic">literal</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[1, 1]</p></td><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">n</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[α<span style="vertical-align: sub; font-size: 80%">N</span>, ∞]</p></td><td><p><span class="hspace"> </span></p></td><td><p><span class="sroman">‹<span style="font-style: italic">class</span>›</span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[1, 1]</p></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\b</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[0, 0]</p></td><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\B</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[0, 0]</p></td></tr></table></td></tr><tr><td align="center"><p><span class="hspace"> </span></p></td></tr><tr><td align="center"><table cellspacing="0" cellpadding="0"><tr><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\p{</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">property</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[1, 6]</p></td><td><p><span class="hspace"> </span></p></td><td><p><span class="RktInBG"><span class="hspace"></span><span class="RktIn">\P{</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">property</span>›</span><span class="RktInBG"><span class="hspace"></span><span class="RktIn">}</span><span class="hspace"></span></span><span class="hspace"> </span><span class="stt">:</span><span class="hspace"> </span>[1, 6]</p></td></tr></table></td></tr></table></p><h5 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-source-pkg="racket-doc" x-part-tag=""Regexp_Constructors"">4.7.3<tt> </tt><a name="(part._.Regexp_.Constructors)"></a>Regexp Constructors</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp~3f))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">v</span> is a <a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp value</span></a> created by
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp%29%29" class="RktValLink" data-pltdoc="x">regexp</a></span> or <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._pregexp%29%29" class="RktValLink" data-pltdoc="x">pregexp</a></span>, <span class="RktVal">#f</span> otherwise.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._pregexp~3f))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._pregexp~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">pregexp?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">v</span> is a <a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp value</span></a> created by
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._pregexp%29%29" class="RktValLink" data-pltdoc="x">pregexp</a></span> (not <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp%29%29" class="RktValLink" data-pltdoc="x">regexp</a></span>), <span class="RktVal">#f</span> otherwise.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._byte-regexp~3f))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">byte-regexp?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">v</span> is a <a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp value</span></a> created by
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp%29%29" class="RktValLink" data-pltdoc="x">byte-regexp</a></span> or <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-pregexp%29%29" class="RktValLink" data-pltdoc="x">byte-pregexp</a></span>, <span class="RktVal">#f</span> otherwise.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._byte-pregexp~3f))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-pregexp~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">byte-pregexp?</a></span></span><span class="hspace"> </span><span class="RktVar">v</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">v</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktVar">v</span> is a <a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp value</span></a> created by
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-pregexp%29%29" class="RktValLink" data-pltdoc="x">byte-pregexp</a></span> (not <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp%29%29" class="RktValLink" data-pltdoc="x">byte-regexp</a></span>), <span class="RktVal">#f</span>
otherwise.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp</a></span></span><span class="hspace"> </span><span class="RktVar">str</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp</a></span></span><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span><span class="RktVar">handler</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">handler</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Takes a string representation of a regular expression (using the
syntax in <a href="#%28part._regexp-syntax%29" data-pltdoc="x">Regexp Syntax</a>) and compiles it into a <a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp
value</span></a>. Other regular expression procedures accept either a string or a
<a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp value</span></a> as the matching pattern. If a regular expression string
is used multiple times, it is faster to compile the string once to a
<a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp value</span></a> and use it for repeated matches instead of using the
string each time.</div></p><p>If <span class="RktVar">handler</span> is provided and not <span class="RktVal">#f</span>, it is called and
its result is returned when <span class="RktVar">str</span> is not a valid representation
of a regular expression; the argument to <span class="RktVar">handler</span> is a string
that describes the problem with <span class="RktVar">str</span>. If <span class="RktVar">handler</span> is
<span class="RktVal">#f</span> or not provided, then <span class="RktSym"><a href="exns.html#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._exn~3afail~3acontract%29%29" class="RktValLink" data-pltdoc="x">exn:fail:contract</a></span> exception is raised.</p><p>The <span class="RktSym"><a href="inspectors.html#%28def._%28%28quote._~23~25kernel%29._object-name%29%29" class="RktValLink" data-pltdoc="x">object-name</a></span> procedure returns
the source string for a <a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp value</span></a>.</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp%29%29" class="RktValLink" data-pltdoc="x">regexp</a></span><span class="hspace"> </span><span class="RktVal">"ap*le"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#rx"ap*le"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="inspectors.html#%28def._%28%28quote._~23~25kernel%29._object-name%29%29" class="RktValLink" data-pltdoc="x">object-name</a></span><span class="hspace"> </span><span class="RktVal">#rx"ap*le"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"ap*le"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp%29%29" class="RktValLink" data-pltdoc="x">regexp</a></span><span class="hspace"> </span><span class="RktVal">"+"</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">s</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktSym">s</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("`+' follows nothing in pattern")</span></p></td></tr></table></blockquote></div></p><p class="SHistory">Changed in version 6.5.0.1 of package <span class="stt">base</span>: Added the <span class="RktVar">handler</span> argument.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._pregexp))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._pregexp%29%29" class="RktValDef RktValLink" data-pltdoc="x">pregexp</a></span></span><span class="hspace"> </span><span class="RktVar">str</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._pregexp%29%29" class="RktValDef RktValLink" data-pltdoc="x">pregexp</a></span></span><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span><span class="RktVar">handler</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">handler</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp%29%29" class="RktValLink" data-pltdoc="x">regexp</a></span>, except that it uses a slightly different syntax
(see <a href="#%28part._regexp-syntax%29" data-pltdoc="x">Regexp Syntax</a>). The result can be used with
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span>, etc., just like the result from
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp%29%29" class="RktValLink" data-pltdoc="x">regexp</a></span>.</div></p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._pregexp%29%29" class="RktValLink" data-pltdoc="x">pregexp</a></span><span class="hspace"> </span><span class="RktVal">"ap*le"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#px"ap*le"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktVal">#px"ap*le"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._pregexp%29%29" class="RktValLink" data-pltdoc="x">pregexp</a></span><span class="hspace"> </span><span class="RktVal">"+"</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">s</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="vectors.html#%28def._%28%28quote._~23~25kernel%29._vector%29%29" class="RktValLink" data-pltdoc="x">vector</a></span><span class="hspace"> </span><span class="RktSym">s</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'#("`+' follows nothing in pattern")</span></p></td></tr></table></blockquote></div></p><p class="SHistory">Changed in version 6.5.0.1 of package <span class="stt">base</span>: Added the <span class="RktVar">handler</span> argument.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._byte-regexp))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp%29%29" class="RktValDef RktValLink" data-pltdoc="x">byte-regexp</a></span></span><span class="hspace"> </span><span class="RktVar">str</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp%29%29" class="RktValDef RktValLink" data-pltdoc="x">byte-regexp</a></span></span><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span><span class="RktVar">handler</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">handler</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Takes a byte-string representation of a regular expression (using the
syntax in <a href="#%28part._regexp-syntax%29" data-pltdoc="x">Regexp Syntax</a>) and compiles it into a
byte-<a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp value</span></a>.</div></p><p>If <span class="RktVar">handler</span> is provided, it is called and its result is returned
if <span class="RktVar">str</span> is not a valid representation of a regular expression.</p><p>The <span class="RktSym"><a href="inspectors.html#%28def._%28%28quote._~23~25kernel%29._object-name%29%29" class="RktValLink" data-pltdoc="x">object-name</a></span> procedure
returns the source byte string for a <a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp value</span></a>.</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp%29%29" class="RktValLink" data-pltdoc="x">byte-regexp</a></span><span class="hspace"> </span><span class="RktVal">#"ap*le"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#rx#"ap*le"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="inspectors.html#%28def._%28%28quote._~23~25kernel%29._object-name%29%29" class="RktValLink" data-pltdoc="x">object-name</a></span><span class="hspace"> </span><span class="RktVal">#rx#"ap*le"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#"ap*le"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp%29%29" class="RktValLink" data-pltdoc="x">byte-regexp</a></span><span class="hspace"> </span><span class="RktVal">"ap*le"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktErr">byte-regexp: contract violation</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">expected: bytes?</span></p></td></tr><tr><td><p><span class="RktErr"></span><span class="hspace"> </span><span class="RktErr">given: "ap*le"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp%29%29" class="RktValLink" data-pltdoc="x">byte-regexp</a></span><span class="hspace"> </span><span class="RktVal">#"+"</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">s</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="hspace"> </span><span class="RktSym">s</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("`+' follows nothing in pattern")</span></p></td></tr></table></blockquote></div></p><p class="SHistory">Changed in version 6.5.0.1 of package <span class="stt">base</span>: Added the <span class="RktVar">handler</span> argument.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._byte-pregexp))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-pregexp%29%29" class="RktValDef RktValLink" data-pltdoc="x">byte-pregexp</a></span></span><span class="hspace"> </span><span class="RktVar">str</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-pregexp%29%29" class="RktValDef RktValLink" data-pltdoc="x">byte-pregexp</a></span></span><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span><span class="RktVar">handler</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">handler</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%29%29" class="RktStxLink" data-pltdoc="x">any</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp%29%29" class="RktValLink" data-pltdoc="x">byte-regexp</a></span>, except that it uses a slightly different
syntax (see <a href="#%28part._regexp-syntax%29" data-pltdoc="x">Regexp Syntax</a>). The result can be used with
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span>, etc., just like the result from
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp%29%29" class="RktValLink" data-pltdoc="x">byte-regexp</a></span>.</div></p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-pregexp%29%29" class="RktValLink" data-pltdoc="x">byte-pregexp</a></span><span class="hspace"> </span><span class="RktVal">#"ap*le"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#px#"ap*le"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-pregexp%29%29" class="RktValLink" data-pltdoc="x">byte-pregexp</a></span><span class="hspace"> </span><span class="RktVal">#"+"</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._~ce~bb%29%29" class="RktStxLink" data-pltdoc="x">λ</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">s</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="vectors.html#%28def._%28%28quote._~23~25kernel%29._vector%29%29" class="RktValLink" data-pltdoc="x">vector</a></span><span class="hspace"> </span><span class="RktSym">s</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'#("`+' follows nothing in pattern")</span></p></td></tr></table></blockquote></div></p><p class="SHistory">Changed in version 6.5.0.1 of package <span class="stt">base</span>: Added the <span class="RktVar">handler</span> argument.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/private/base..rkt)._regexp-quote))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-quote%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-quote</a></span></span><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span>[<span class="RktVar">case-sensitive?</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">case-sensitive?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#t</span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-quote%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-quote</a></span></span><span class="hspace"> </span><span class="RktVar">bstr</span><span class="hspace"> </span>[<span class="RktVar">case-sensitive?</span>]<span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">bstr</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">case-sensitive?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#t</span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a string or byte string suitable for use with <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp%29%29" class="RktValLink" data-pltdoc="x">regexp</a></span>
to match the literal sequence of characters in <span class="RktVar">str</span> or
sequence of bytes in <span class="RktVar">bstr</span>. If <span class="RktVar">case-sensitive?</span> is
true (the default), the resulting regexp matches letters in
<span class="RktVar">str</span> or <span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes%29%29" class="RktValLink" data-pltdoc="x">bytes</a></span> case-sensitively, otherwise it matches
case-insensitively.</div></p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="hspace"> </span><span class="RktVal">"."</span><span class="hspace"> </span><span class="RktVal">"apple.scm"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("a")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-quote%29%29" class="RktValLink" data-pltdoc="x">regexp-quote</a></span><span class="hspace"> </span><span class="RktVal">"."</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"apple.scm"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(".")</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp-max-lookbehind))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-max-lookbehind%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-max-lookbehind</a></span></span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Returns the maximum number of bytes that <span class="RktVar">pattern</span> may consult
before the starting position of a match to determine the match. For
example, the pattern <span class="RktInBG"><span class="hspace"></span><span class="RktIn">(?<=abc)d</span><span class="hspace"></span></span> consults three bytes
preceding a matching <span class="RktInBG"><span class="hspace"></span><span class="RktIn">d</span><span class="hspace"></span></span>, while <span class="RktInBG"><span class="hspace"></span><span class="RktIn">e(?<=a..)d</span><span class="hspace"></span></span> consults
two bytes before a matching <span class="RktInBG"><span class="hspace"></span><span class="RktIn">ed</span><span class="hspace"></span></span>. A <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span> pattern may
consult a preceding byte to determine whether the current position is
the start of the input or of a line.</div></p><h5 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-source-pkg="racket-doc" x-part-tag=""Regexp_Matching"">4.7.4<tt> </tt><a name="(part._.Regexp_.Matching)"></a>Regexp Matching</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp-match))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">output-port</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._and%29%29" class="RktStxLink" data-pltdoc="x">and</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVar">input</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktVar">input</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">output-port</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._output-port~3f%29%29" class="RktValLink" data-pltdoc="x">output-port?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr></table></blockquote></div><div class="SIntrapara">Attempts to match <span class="RktVar">pattern</span> (a string, byte string,
<a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp value</span></a>, or byte-<a href="#%28tech._regexp._value%29" class="techoutside" data-pltdoc="x"><span class="techinside">regexp value</span></a>) once to a portion of
<span class="RktVar">input</span>. The matcher finds a portion of <span class="RktVar">input</span> that
matches and is closest to the start of the input (after
<span class="RktVar">start-pos</span>).</div></p><p>If <span class="RktVar">input</span> is a path, it is converted to a byte string with
<span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path-~3ebytes%29%29" class="RktValLink" data-pltdoc="x">path->bytes</a></span> if <span class="RktVar">pattern</span> is a byte string or a
byte-based regexp. Otherwise, <span class="RktVar">input</span> is converted to a string
with <span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path-~3estring%29%29" class="RktValLink" data-pltdoc="x">path->string</a></span>.</p><p>The optional <span class="RktVar">start-pos</span> and <span class="RktVar">end-pos</span> arguments select
a portion of <span class="RktVar">input</span> for matching; the default is the entire
string or the stream up to an end-of-file. When <span class="RktVar">input</span> is a
string, <span class="RktVar">start-pos</span> is a character position; when
<span class="RktVar">input</span> is a byte string, then <span class="RktVar">start-pos</span> is a byte
position; and when <span class="RktVar">input</span> is an input port, <span class="RktVar">start-pos</span>
is the number of bytes to skip before starting to match. The
<span class="RktVar">end-pos</span> argument can be <span class="RktVal">#f</span>, which corresponds to the
end of the string or an end-of-file in the stream; otherwise, it is a
character or byte position, like <span class="RktVar">start-pos</span>. If <span class="RktVar">input</span>
is an input port, and if an end-of-file is reached before
<span class="RktVar">start-pos</span> bytes are skipped, then the match fails.</p><p>In <span class="RktVar">pattern</span>, a start-of-string <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span> refers to the first
position of <span class="RktVar">input</span> after <span class="RktVar">start-pos</span>, assuming that
<span class="RktVar">input-prefix</span> is <span class="RktVal">#""</span>. The end-of-input <span class="RktInBG"><span class="hspace"></span><span class="RktIn">$</span><span class="hspace"></span></span>
refers to the <span class="RktVar">end-pos</span>th position or (in the case of an input
port) an end-of-file, whichever comes first.</p><p>The <span class="RktVar">input-prefix</span> specifies bytes that effectively precede
<span class="RktVar">input</span> for the purposes of <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span> and other look-behind
matching. For example, a <span class="RktVal">#""</span> prefix means that <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span>
matches at the beginning of the stream, while a <span class="RktVal">#"\n"</span>
<span class="RktVar">input-prefix</span> means that a start-of-line <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span> can match
the beginning of the input, while a start-of-file <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span> cannot.</p><p>If the match fails, <span class="RktVal">#f</span> is returned. If the match succeeds, a
list containing strings or byte string, and possibly <span class="RktVal">#f</span>, is
returned. The list contains strings only if <span class="RktVar">input</span> is a string
and <span class="RktVar">pattern</span> is not a byte regexp. Otherwise, the list
contains byte strings (substrings of the UTF-8 encoding of
<span class="RktVar">input</span>, if <span class="RktVar">input</span> is a string).</p><p>The first [byte] string in a result list is the portion of
<span class="RktVar">input</span> that matched <span class="RktVar">pattern</span>. If two portions of
<span class="RktVar">input</span> can match <span class="RktVar">pattern</span>, then the match that starts
earliest is found.</p><p>Additional [byte] strings are returned in the list if <span class="RktVar">pattern</span>
contains parenthesized sub-expressions (but not when the opening
parenthesis is followed by <span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span>). Matches for the
sub-expressions are provided in the order of the opening parentheses
in <span class="RktVar">pattern</span>. When sub-expressions occur in branches of an
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">|</span><span class="hspace"></span></span> “or” pattern, in a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">*</span><span class="hspace"></span></span> “zero or more”
pattern, or other places where the overall pattern can succeed without
a match for the sub-expression, then a <span class="RktVal">#f</span> is returned for the
sub-expression if it did not contribute to the final match. When a
single sub-expression occurs within a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">*</span><span class="hspace"></span></span> “zero or more”
pattern or other multiple-match positions, then the rightmost match
associated with the sub-expression is returned in the list.</p><p>If the optional <span class="RktVar">output-port</span> is provided as an output port,
the part of <span class="RktVar">input</span> from its beginning (not <span class="RktVar">start-pos</span>)
that precedes the match is written to the port. All of <span class="RktVar">input</span>
up to <span class="RktVar">end-pos</span> is written to the port if no match is
found. This functionality is most useful when <span class="RktVar">input</span> is an
input port.</p><p>When matching an input port, a match failure reads up to
<span class="RktVar">end-pos</span> bytes (or end-of-file), even if <span class="RktVar">pattern</span>
begins with a start-of-string <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span>; see also
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-try-match%29%29" class="RktValLink" data-pltdoc="x">regexp-try-match</a></span>. On success, all bytes up to and including
the match are eventually read from the port, but matching proceeds by
first peeking bytes from the port (using <span class="RktSym"><a href="Byte_and_String_Input.html#%28def._%28%28quote._~23~25kernel%29._peek-bytes-avail%21%29%29" class="RktValLink" data-pltdoc="x">peek-bytes-avail!</a></span>),
and then (re‑)reading matching bytes to discard them after the match
result is determined. Non-matching bytes may be read and discarded
before the match is determined. The matcher peeks in blocking mode
only as far as necessary to determine a match, but it may peek extra
bytes to fill an internal buffer if immediately available (i.e.,
without blocking). Greedy repeat operators in <span class="RktVar">pattern</span>, such
as <span class="RktInBG"><span class="hspace"></span><span class="RktIn">*</span><span class="hspace"></span></span> or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">+</span><span class="hspace"></span></span>, tend to force reading the entire
content of the port (up to <span class="RktVar">end-pos</span>) to determine a match.</p><p>If the input port is read simultaneously by another thread, or if the
port is a custom port with inconsistent reading and peeking procedures
(see <a href="customport.html" data-pltdoc="x">Custom Ports</a>), then the bytes that are peeked and
used for matching may be different than the bytes read and discarded
after the match completes; the matcher inspects only the peeked
bytes. To avoid such interleaving, use <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek%29%29" class="RktValLink" data-pltdoc="x">regexp-match-peek</a></span>
(with a <span class="RktSym">progress-evt</span> argument) followed by
<span class="RktSym"><a href="Byte_and_String_Input.html#%28def._%28%28quote._~23~25kernel%29._port-commit-peeked%29%29" class="RktValLink" data-pltdoc="x">port-commit-peeked</a></span>.</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="hspace"> </span><span class="RktVal">#rx"x."</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("x4")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="hspace"> </span><span class="RktVal">#rx"y."</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="hspace"> </span><span class="RktVal">#rx"x."</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="hspace"> </span><span class="RktVal">3</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("x6")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="hspace"> </span><span class="RktVal">#rx"x."</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="hspace"> </span><span class="RktVal">3</span><span class="hspace"> </span><span class="RktVal">4</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="hspace"> </span><span class="RktVal">#rx#"x."</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(#"x4")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="hspace"> </span><span class="RktVal">#rx"x."</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="hspace"> </span><span class="RktVal">0</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._current-output-port%29%29" class="RktValLink" data-pltdoc="x">current-output-port</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">12</span></p></td></tr><tr><td><p><span class="RktRes">'("x4")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="hspace"> </span><span class="RktVal">#rx"(-[0-9]*)+"</span><span class="hspace"> </span><span class="RktVal">"a-12--345b"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("-12--345" "-345")</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((lib._racket/private/base..rkt)._regexp-match*))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match%2A%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match*</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">#:match-select</span><span class="hspace"> </span><span class="RktVar">match-select</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">#:gap-select?</span><span class="hspace"> </span><span class="RktVar">gap-select</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._and%29%29" class="RktStxLink" data-pltdoc="x">and</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVar">input</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktVar">input</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">match-select</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top">:</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list~3f%29%29" class="RktValLink" data-pltdoc="x">list?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list~3f%29%29" class="RktValLink" data-pltdoc="x">list?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr></table></td><td valign="top"><span class="hspace"> </span></td><td valign="top">=</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._car%29%29" class="RktValLink" data-pltdoc="x">car</a></span></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">gap-select</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span>, but the result is a list of strings or
byte strings corresponding to a sequence of matches of
<span class="RktVar">pattern</span> in <span class="RktVar">input</span>.</div></p><p>The <span class="RktVar">pattern</span> is used in order to find matches, where each
match attempt starts at the end of the last match, and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span> is
allowed to match the beginning of the input (if <span class="RktVar">input-prefix</span>
is <span class="RktVal">#""</span>) only for the first match. Empty matches are handled
like other matches, returning a zero-length string or byte sequence
(they are more useful in making this a complement of
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-split%29%29" class="RktValLink" data-pltdoc="x">regexp-split</a></span>), but <span class="RktVar">pattern</span> is restricted from
matching an empty sequence immediately after an empty match.</p><p>If <span class="RktVar">input</span> contains no matches (in the range <span class="RktVar">start-pos</span>
to <span class="RktVar">end-pos</span>), <span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._null%29%29" class="RktValLink" data-pltdoc="x">null</a></span> is returned. Otherwise, each item
in the resulting list is a distinct substring or byte sequence from
<span class="RktVar">input</span> that matches <span class="RktVar">pattern</span>. The <span class="RktVar">end-pos</span>
argument can be <span class="RktVal">#f</span> to match to the end of <span class="RktVar">input</span>
(which corresponds to an end-of-file if <span class="RktVar">input</span> is an input
port).</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-match*</a></span><span class="hspace"> </span><span class="RktVal">#rx"x."</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("x4" "x6")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-match*</a></span><span class="hspace"> </span><span class="RktVal">#rx"x*"</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("" "" "x" "" "x" "" "")</span></p></td></tr></table></blockquote></div></p><p><span class="RktVar">match-select</span> specifies the collected results. The default of
<span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._car%29%29" class="RktValLink" data-pltdoc="x">car</a></span> means that the result is the list of matches without
returning parenthesized sub-patterns. It can be given as a ‘selector’
function which chooses an item from a list, or it can choose a list of
items. For example, you can use <span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._cdr%29%29" class="RktValLink" data-pltdoc="x">cdr</a></span> to get a list of lists
of parenthesized sub-patterns matches, or <span class="RktSym"><a href="values.html#%28def._%28%28quote._~23~25kernel%29._values%29%29" class="RktValLink" data-pltdoc="x">values</a></span> (as an
identity function) to get the full matches as well. (Note that the
selector must choose an element of its input list or a list of
elements, but it must not inspect its input as they can be either a
list of strings or a list of position pairs. Furthermore, the
selector must be consistent in its choice(s).)</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-match*</a></span><span class="hspace"> </span><span class="RktVal">#rx"x(.)"</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="hspace"> </span><span class="RktPn">#:match-select</span><span class="hspace"> </span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._cadr%29%29" class="RktValLink" data-pltdoc="x">cadr</a></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("4" "6")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-match*</a></span><span class="hspace"> </span><span class="RktVal">#rx"x(.)"</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="hspace"> </span><span class="RktPn">#:match-select</span><span class="hspace"> </span><span class="RktSym"><a href="values.html#%28def._%28%28quote._~23~25kernel%29._values%29%29" class="RktValLink" data-pltdoc="x">values</a></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(("x4" "4") ("x6" "6"))</span></p></td></tr></table></blockquote></div></p><p>In addition, specifying <span class="RktVar">gap-select</span> as a non-<span class="RktVal">#f</span> value
will make the result an interleaved list of the matches as well as the
separators between them matches, starting and ending with a separator.
In this case, <span class="RktVar">match-select</span> can be given as <span class="RktVal">#f</span> to
return <span style="font-style: italic">only</span> the separators, making such uses equivalent to
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-split%29%29" class="RktValLink" data-pltdoc="x">regexp-split</a></span>.</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-match*</a></span><span class="hspace"> </span><span class="RktVal">#rx"x(.)"</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="hspace"> </span><span class="RktPn">#:match-select</span><span class="hspace"> </span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._cadr%29%29" class="RktValLink" data-pltdoc="x">cadr</a></span><span class="hspace"> </span><span class="RktPn">#:gap-select?</span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("12" "4" "" "6" "")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-match*</a></span><span class="hspace"> </span><span class="RktVal">#rx"x(.)"</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="hspace"> </span><span class="RktPn">#:match-select</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">#:gap-select?</span><span class="hspace"> </span><span class="RktVal">#t</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("12" "" "")</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((lib._racket/private/base..rkt)._regexp-try-match))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-try-match%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-try-match</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">output-port</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._and%29%29" class="RktStxLink" data-pltdoc="x">and</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVar">input</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">output-port</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._output-port~3f%29%29" class="RktValLink" data-pltdoc="x">output-port?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span> on input ports, except that if the match
fails, no characters are read and discarded from <span class="RktSym">in</span>.</div></p><p>This procedure is especially useful with a <span class="RktVar">pattern</span> that
begins with a start-of-string <span class="RktInBG"><span class="hspace"></span><span class="RktIn">^</span><span class="hspace"></span></span> or with a non-<span class="RktVal">#f</span>
<span class="RktVar">end-pos</span>, since each limits the amount of peeking into the
port. Otherwise, beware that a large portion of the stream may be
peeked (and therefore pulled into memory) before the match succeeds or
fails.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp-match-positions))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-positions%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match-positions</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">output-port</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">output-port</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._output-port~3f%29%29" class="RktValLink" data-pltdoc="x">output-port?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span>, but returns a list of number pairs (and
<span class="RktVal">#f</span>) instead of a list of strings. Each pair of numbers refers
to a range of characters or bytes in <span class="RktVar">input</span>. If the result for
the same arguments with <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span> would be a list of byte
strings, the resulting ranges correspond to byte ranges; in that case,
if <span class="RktVar">input</span> is a character string, the byte ranges correspond to
bytes in the UTF-8 encoding of the string.</div></p><p>Range results are returned in a <span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._substring%29%29" class="RktValLink" data-pltdoc="x">substring</a></span>- and
<span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._subbytes%29%29" class="RktValLink" data-pltdoc="x">subbytes</a></span>-compatible manner, independent of
<span class="RktVar">start-pos</span>. In the case of an input port, the returned
positions indicate the number of bytes that were read, including
<span class="RktVar">start-pos</span>, before the first matching byte.</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-positions%29%29" class="RktValLink" data-pltdoc="x">regexp-match-positions</a></span><span class="hspace"> </span><span class="RktVal">#rx"x."</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'((2 . 4))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-positions%29%29" class="RktValLink" data-pltdoc="x">regexp-match-positions</a></span><span class="hspace"> </span><span class="RktVal">#rx"x."</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="hspace"> </span><span class="RktVal">3</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'((4 . 6))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-positions%29%29" class="RktValLink" data-pltdoc="x">regexp-match-positions</a></span><span class="hspace"> </span><span class="RktVal">#rx"(-[0-9]*)+"</span><span class="hspace"> </span><span class="RktVal">"a-12--345b"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'((1 . 9) (5 . 9))</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((lib._racket/private/base..rkt)._regexp-match-positions*))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match-positions%2A%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match-positions*</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">#:match-select</span><span class="hspace"> </span><span class="RktVar">match-select</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">match-select</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list~3f%29%29" class="RktValLink" data-pltdoc="x">list?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list~3f%29%29" class="RktValLink" data-pltdoc="x">list?</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._car%29%29" class="RktValLink" data-pltdoc="x">car</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-positions%29%29" class="RktValLink" data-pltdoc="x">regexp-match-positions</a></span>, but returns multiple matches
like <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-match*</a></span>.</div></p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match-positions%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-match-positions*</a></span><span class="hspace"> </span><span class="RktVal">#rx"x."</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'((2 . 4) (4 . 6))</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match-positions%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-match-positions*</a></span><span class="hspace"> </span><span class="RktVal">#rx"x(.)"</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="hspace"> </span><span class="RktPn">#:match-select</span><span class="hspace"> </span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._cadr%29%29" class="RktValLink" data-pltdoc="x">cadr</a></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'((3 . 4) (5 . 6))</span></p></td></tr></table></blockquote></div></p><p>Note that unlike <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-match*</a></span>, there is no
<span class="RktPn">#:gap-select?</span> input keyword, as this information can be easily
inferred from the resulting matches.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp-match~3f))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match?</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">output-port</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">output-port</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._output-port~3f%29%29" class="RktValLink" data-pltdoc="x">output-port?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span>, but returns merely <span class="RktVal">#t</span> when the
match succeeds, <span class="RktVal">#f</span> otherwise.</div></p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match~3f%29%29" class="RktValLink" data-pltdoc="x">regexp-match?</a></span><span class="hspace"> </span><span class="RktVal">#rx"x."</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match~3f%29%29" class="RktValLink" data-pltdoc="x">regexp-match?</a></span><span class="hspace"> </span><span class="RktVal">#rx"y."</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/private/base..rkt)._regexp-match-exact~3f))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match-exact~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match-exact?</a></span></span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span><span class="RktVar">input</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="booleans.html#%28def._%28%28quote._~23~25kernel%29._boolean~3f%29%29" class="RktValLink" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match~3f%29%29" class="RktValLink" data-pltdoc="x">regexp-match?</a></span>, but <span class="RktVal">#t</span> is only returned when the
entire content of <span class="RktVar">input</span> matches <span class="RktVar">pattern</span>.</div></p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match-exact~3f%29%29" class="RktValLink" data-pltdoc="x">regexp-match-exact?</a></span><span class="hspace"> </span><span class="RktVal">#rx"x."</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match-exact~3f%29%29" class="RktValLink" data-pltdoc="x">regexp-match-exact?</a></span><span class="hspace"> </span><span class="RktVal">#rx"1.*x."</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#t</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp-match-peek))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match-peek</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">progress</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">progress</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym">evt</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span> on input ports, but only peeks bytes from
<span class="RktVar">input</span> instead of reading them. Furthermore, instead of
an output port, the last optional argument is a progress event for
<span class="RktVar">input</span> (see <span class="RktSym"><a href="Byte_and_String_Input.html#%28def._%28%28quote._~23~25kernel%29._port-progress-evt%29%29" class="RktValLink" data-pltdoc="x">port-progress-evt</a></span>). If <span class="RktVar">progress</span>
becomes ready, then the match stops peeking from <span class="RktVar">input</span>
and returns <span class="RktVal">#f</span>. The <span class="RktVar">progress</span> argument can be
<span class="RktVal">#f</span>, in which case the peek may continue with inconsistent
information if another process meanwhile reads from
<span class="RktVar">input</span>.</div></p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="define.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._define%29%29" class="RktStxLink" data-pltdoc="x">define</a></span><span class="hspace"> </span><span class="RktSym">p</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="stringport.html#%28def._%28%28quote._~23~25kernel%29._open-input-string%29%29" class="RktValLink" data-pltdoc="x">open-input-string</a></span><span class="hspace"> </span><span class="RktVal">"a abcd"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek%29%29" class="RktValLink" data-pltdoc="x">regexp-match-peek</a></span><span class="hspace"> </span><span class="RktVal">".*bc"</span><span class="hspace"> </span><span class="RktSym">p</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(#"a abc")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek%29%29" class="RktValLink" data-pltdoc="x">regexp-match-peek</a></span><span class="hspace"> </span><span class="RktVal">".*bc"</span><span class="hspace"> </span><span class="RktSym">p</span><span class="hspace"> </span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(#"abc")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="hspace"> </span><span class="RktVal">".*bc"</span><span class="hspace"> </span><span class="RktSym">p</span><span class="hspace"> </span><span class="RktVal">2</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'(#"abc")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Byte_and_String_Input.html#%28def._%28%28quote._~23~25kernel%29._peek-char%29%29" class="RktValLink" data-pltdoc="x">peek-char</a></span><span class="hspace"> </span><span class="RktSym">p</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#\d</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span><span class="hspace"> </span><span class="RktVal">".*bc"</span><span class="hspace"> </span><span class="RktSym">p</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#f</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Byte_and_String_Input.html#%28def._%28%28quote._~23~25kernel%29._peek-char%29%29" class="RktValLink" data-pltdoc="x">peek-char</a></span><span class="hspace"> </span><span class="RktSym">p</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">#<eof></span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp-match-peek-positions))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek-positions%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match-peek-positions</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">progress</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">progress</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym">evt</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-positions%29%29" class="RktValLink" data-pltdoc="x">regexp-match-positions</a></span> on input ports, but only peeks
bytes from <span class="RktVar">input</span> instead of reading them, and with a
<span class="RktVar">progress</span> argument like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek%29%29" class="RktValLink" data-pltdoc="x">regexp-match-peek</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp-match-peek-immediate))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek-immediate%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match-peek-immediate</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">progress</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">progress</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym">evt</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek%29%29" class="RktValLink" data-pltdoc="x">regexp-match-peek</a></span>, but it attempts to match only bytes
that are available from <span class="RktVar">input</span> without blocking. The
match fails if not-yet-available characters might be used to match
<span class="RktVar">pattern</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp-match-peek-positions-immediate))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek-positions-immediate%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match-peek-positions-immediate</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">progress</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">progress</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym">evt</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek-positions%29%29" class="RktValLink" data-pltdoc="x">regexp-match-peek-positions</a></span>, but it attempts to match
only bytes that are available from <span class="RktVar">input</span> without
blocking. The match fails if not-yet-available characters might be
used to match <span class="RktVar">pattern</span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((lib._racket/private/base..rkt)._regexp-match-peek-positions*))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match-peek-positions%2A%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match-peek-positions*</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">#:match-select</span><span class="hspace"> </span><span class="RktVar">match-select</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">match-select</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list~3f%29%29" class="RktValLink" data-pltdoc="x">list?</a></span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span></a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fmisc..rkt%29._any%2Fc%29%29" class="RktValLink" data-pltdoc="x">any/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list~3f%29%29" class="RktValLink" data-pltdoc="x">list?</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._car%29%29" class="RktValLink" data-pltdoc="x">car</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek-positions%29%29" class="RktValLink" data-pltdoc="x">regexp-match-peek-positions</a></span>, but returns multiple matches like
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match-positions%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-match-positions*</a></span>.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp-match/end))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%2Fend%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match/end</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">output-port</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">count</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._and%29%29" class="RktStxLink" data-pltdoc="x">and</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVar">input</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktVar">input</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">output-port</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._output-port~3f%29%29" class="RktValLink" data-pltdoc="x">output-port?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">count</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">1</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span>, but with a second result: a byte
string of up to <span class="RktVar">count</span> bytes that correspond to the input
(possibly including the <span class="RktVar">input-prefix</span>) leading to the end of
the match; the second result is <span class="RktVal">#f</span> if no match is found.</div></p><p>The second result can be useful as an <span class="RktVar">input-prefix</span> for
attempting a second match on <span class="RktVar">input</span> starting from the end of
the first match. In that case, use <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-max-lookbehind%29%29" class="RktValLink" data-pltdoc="x">regexp-max-lookbehind</a></span>
to determine an appropriate value for <span class="RktVar">count</span>.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp-match-positions/end))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-positions%2Fend%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match-positions/end</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">count</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="Manipulating_Paths.html#%28def._%28%28quote._~23~25kernel%29._path~3f%29%29" class="RktValLink" data-pltdoc="x">path?</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">count</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">1</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp-match-peek-positions/end))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek-positions%2Fend%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match-peek-positions/end</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">progress</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">count</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">progress</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym">evt</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">count</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">1</span></td></tr></table></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="together"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp-match-peek-positions-immediate/end))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-peek-positions-immediate%2Fend%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-match-peek-positions-immediate/end</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">progress</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">count</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">progress</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym">evt</span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">count</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">1</span></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match-positions%29%29" class="RktValLink" data-pltdoc="x">regexp-match-positions</a></span>, etc., but with a second result
like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%2Fend%29%29" class="RktValLink" data-pltdoc="x">regexp-match/end</a></span>.</div></p><h5 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-source-pkg="racket-doc" x-part-tag=""Regexp_Splitting"">4.7.5<tt> </tt><a name="(part._.Regexp_.Splitting)"></a>Regexp Splitting</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((lib._racket/private/base..rkt)._regexp-split))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-split%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-split</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._and%29%29" class="RktStxLink" data-pltdoc="x">and</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVar">input</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._cons%2Fc%29%29" class="RktValLink" data-pltdoc="x">cons/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="port-ops.html#%28def._%28%28quote._~23~25kernel%29._input-port~3f%29%29" class="RktValLink" data-pltdoc="x">input-port?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr></table></blockquote></div><div class="SIntrapara">The complement of <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-match*</a></span>: the result is a list of
strings (if <span class="RktVar">pattern</span> is a string or character regexp and
<span class="RktVar">input</span> is a string) or byte strings (otherwise) from
<span class="RktVar">input</span> that are separated by matches to
<span class="RktVar">pattern</span>. Adjacent matches are separated with <span class="RktVal">""</span> or
<span class="RktVal">#""</span>. Zero-length matches are treated the same as for
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-match*</a></span>.</div></p><p>If <span class="RktVar">input</span> contains no matches (in the range <span class="RktVar">start-pos</span>
to <span class="RktVar">end-pos</span>), the result is a list containing <span class="RktVar">input</span>’s
content (from <span class="RktVar">start-pos</span> to <span class="RktVar">end-pos</span>) as a single
element. If a match occurs at the beginning of <span class="RktVar">input</span> (at
<span class="RktVar">start-pos</span>), the resulting list will start with an empty
string or byte string, and if a match occurs at the end (at
<span class="RktVar">end-pos</span>), the list will end with an empty string or byte
string. The <span class="RktVar">end-pos</span> argument can be <span class="RktVal">#f</span>, in which
case splitting goes to the end of <span class="RktVar">input</span> (which corresponds to
an end-of-file if <span class="RktVar">input</span> is an input port).</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-split%29%29" class="RktValLink" data-pltdoc="x">regexp-split</a></span><span class="hspace"> </span><span class="RktVal">#rx" +"</span><span class="hspace"> </span><span class="RktVal">"12</span><span class="hspace"> </span><span class="RktVal">34"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("12" "34")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-split%29%29" class="RktValLink" data-pltdoc="x">regexp-split</a></span><span class="hspace"> </span><span class="RktVal">#rx"."</span><span class="hspace"> </span><span class="RktVal">"12</span><span class="hspace"> </span><span class="RktVal">34"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("" "" "" "" "" "" "")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-split%29%29" class="RktValLink" data-pltdoc="x">regexp-split</a></span><span class="hspace"> </span><span class="RktVal">#rx""</span><span class="hspace"> </span><span class="RktVal">"12</span><span class="hspace"> </span><span class="RktVal">34"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("" "1" "2" " " " " "3" "4" "")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-split%29%29" class="RktValLink" data-pltdoc="x">regexp-split</a></span><span class="hspace"> </span><span class="RktVal">#rx" *"</span><span class="hspace"> </span><span class="RktVal">"12</span><span class="hspace"> </span><span class="RktVal">34"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("" "1" "2" "" "3" "4" "")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-split%29%29" class="RktValLink" data-pltdoc="x">regexp-split</a></span><span class="hspace"> </span><span class="RktVal">#px"\\b"</span><span class="hspace"> </span><span class="RktVal">"12, 13 and 14."</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("" "12" ", " "13" " " "and" " " "14" ".")</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-split%29%29" class="RktValLink" data-pltdoc="x">regexp-split</a></span><span class="hspace"> </span><span class="RktVal">#rx" +"</span><span class="hspace"> </span><span class="RktVal">""</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">'("")</span></p></td></tr></table></blockquote></div></p><h5 x-source-module="(lib "scribblings/reference/reference.scrbl")" x-source-pkg="racket-doc" x-part-tag=""Regexp_Substitution"">4.7.6<tt> </tt><a name="(part._.Regexp_.Substitution)"></a>Regexp Substitution</h5><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((quote._~23~25kernel)._regexp-replace))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-replace%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-replace</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">insert</span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">input-prefix</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td></tr></table></blockquote></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="prototype"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28quote._~23~25kernel%29._if%29%29" class="RktStxLink" data-pltdoc="x">if</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._and%29%29" class="RktStxLink" data-pltdoc="x">and</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._or%29%29" class="RktStxLink" data-pltdoc="x">or</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktVar">pattern</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktVar">input</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">insert</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top">:</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">#:rest</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%2A%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span>*</a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">(</span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">#:rest</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%2A%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span>*</a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr></table></blockquote></div><div class="SIntrapara">Performs a match using <span class="RktVar">pattern</span> on <span class="RktVar">input</span>, and then
returns a string or byte string in which the matching portion of
<span class="RktVar">input</span> is replaced with <span class="RktVar">insert</span>. If <span class="RktVar">pattern</span>
matches no part of <span class="RktVar">input</span>, then <span class="RktVar">input</span> is returned
unmodified.</div></p><p>The <span class="RktVar">insert</span> argument can be either a (byte) string, or a
function that returns a (byte) string. In the latter case, the
function is applied on the list of values that <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-match%29%29" class="RktValLink" data-pltdoc="x">regexp-match</a></span>
would return (i.e., the first argument is the complete match, and then
one argument for each parenthesized sub-expression) to obtain a
replacement (byte) string.</p><p>If <span class="RktVar">pattern</span> is a string or character regexp and <span class="RktVar">input</span>
is a string, then <span class="RktVar">insert</span> must be a string or a procedure that
accept strings, and the result is a string. If <span class="RktVar">pattern</span> is a
byte string or byte regexp, or if <span class="RktVar">input</span> is a byte string,
then <span class="RktVar">insert</span> as a string is converted to a byte string,
<span class="RktVar">insert</span> as a procedure is called with a byte string, and the
result is a byte string.</p><p>If <span class="RktVar">insert</span> contains <span class="RktInBG"><span class="hspace"></span><span class="RktIn">&</span><span class="hspace"></span></span>, then <span class="RktInBG"><span class="hspace"></span><span class="RktIn">&</span><span class="hspace"></span></span>
is replaced with the matching portion of <span class="RktVar">input</span> before it is
substituted into the match’s place. If <span class="RktVar">insert</span> contains
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">n</span>›</span> for some integer <span class="sroman">‹<span style="font-style: italic">n</span>›</span>, then it is
replaced with the <span class="sroman">‹<span style="font-style: italic">n</span>›</span>th matching sub-expression from
<span class="RktVar">input</span>. A <span class="RktInBG"><span class="hspace"></span><span class="RktIn">&</span><span class="hspace"></span></span> and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\0</span><span class="hspace"></span></span> are aliases. If
the <span class="sroman">‹<span style="font-style: italic">n</span>›</span>th sub-expression was not used in the match, or if
<span class="sroman">‹<span style="font-style: italic">n</span>›</span> is greater than the number of sub-expressions in
<span class="RktVar">pattern</span>, then <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span><span class="sroman">‹<span style="font-style: italic">n</span>›</span> is replaced with the
empty string.</p><p>To substitute a literal <span class="RktInBG"><span class="hspace"></span><span class="RktIn">&</span><span class="hspace"></span></span> or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span>, use
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">\&</span><span class="hspace"></span></span> and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\\</span><span class="hspace"></span></span>, respectively, in
<span class="RktVar">insert</span>. A <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\$</span><span class="hspace"></span></span> in <span class="RktVar">insert</span> is
equivalent to an empty sequence; this can be used to terminate a
number <span class="sroman">‹<span style="font-style: italic">n</span>›</span> following <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span>. If a <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span> in
<span class="RktVar">insert</span> is followed by anything other than a digit,
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">&</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span>, or <span class="RktInBG"><span class="hspace"></span><span class="RktIn">$</span><span class="hspace"></span></span>, then the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span>
by itself is treated as <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\0</span><span class="hspace"></span></span>.</p><p>Note that the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span> described in the previous paragraphs is a
character or byte of <span class="RktVar">input</span>. To write such an <span class="RktVar">input</span>
as a Racket string literal, an escaping <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span> is needed
before the <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span>. For example, the Racket constant
<span class="RktVal">"\\1"</span> is <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\1</span><span class="hspace"></span></span>.</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-replace%29%29" class="RktValLink" data-pltdoc="x">regexp-replace</a></span><span class="hspace"> </span><span class="RktVal">#rx"mi"</span><span class="hspace"> </span><span class="RktVal">"mi casa"</span><span class="hspace"> </span><span class="RktVal">"su"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"su casa"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-replace%29%29" class="RktValLink" data-pltdoc="x">regexp-replace</a></span><span class="hspace"> </span><span class="RktVal">#rx"mi"</span><span class="hspace"> </span><span class="RktVal">"mi casa"</span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string-upcase%29%29" class="RktValLink" data-pltdoc="x">string-upcase</a></span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"MI casa"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-replace%29%29" class="RktValLink" data-pltdoc="x">regexp-replace</a></span><span class="hspace"> </span><span class="RktVal">#rx"([Mm])i ([a-zA-Z]*)"</span><span class="hspace"> </span><span class="RktVal">"Mi Casa"</span><span class="hspace"> </span><span class="RktVal">"\\1y \\2"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"My Casa"</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-replace%29%29" class="RktValLink" data-pltdoc="x">regexp-replace</a></span><span class="hspace"> </span><span class="RktVal">#rx"([Mm])i ([a-zA-Z]*)"</span><span class="hspace"> </span><span class="RktVal">"mi cerveza Mi Mi Mi"</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">"\\1y \\2"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">"my cerveza Mi Mi Mi"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-replace%29%29" class="RktValLink" data-pltdoc="x">regexp-replace</a></span><span class="hspace"> </span><span class="RktVal">#rx"x"</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="hspace"> </span><span class="RktVal">"\\\\"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"12\\4x6"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._display%29%29" class="RktValLink" data-pltdoc="x">display</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-replace%29%29" class="RktValLink" data-pltdoc="x">regexp-replace</a></span><span class="hspace"> </span><span class="RktVal">#rx"x"</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="hspace"> </span><span class="RktVal">"\\\\"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">12\4x6</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td valign="top"><span class="RktPn">(</span><a name="(def._((lib._racket/private/base..rkt)._regexp-replace*))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replace%2A%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-replace*</a></span></span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">pattern</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">insert</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span>[</td><td valign="top"><span class="RktVar">start-pos</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">end-pos</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td></tr><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">input-prefix</span>]<span class="RktPn">)</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top">→</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">pattern</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">insert</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top">:</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">#:rest</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%2A%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span>*</a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">(</span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">#:rest</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%2A%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span>*</a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">start-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">0</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">end-pos</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="number-types.html#%28def._%28%28quote._~23~25kernel%29._exact-nonnegative-integer~3f%29%29" class="RktValLink" data-pltdoc="x">exact-nonnegative-integer?</a></span><span class="hspace"> </span><span class="RktVal">#f</span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input-prefix</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#""</span></td></tr></table></blockquote></div><div class="SIntrapara">Like <span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-replace%29%29" class="RktValLink" data-pltdoc="x">regexp-replace</a></span>, except that every instance of
<span class="RktVar">pattern</span> in <span class="RktVar">input</span> is replaced with <span class="RktVar">insert</span>,
instead of just the first match. Only non-overlapping instances of
<span class="RktVar">pattern</span> in <span class="RktVar">input</span> are replaced, so instances of
<span class="RktVar">pattern</span> within inserted strings are <span style="font-style: italic">not</span> replaced
recursively. Zero-length matches are treated the same as in
<span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-match%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-match*</a></span>.</div></p><p>The optional <span class="RktVar">start-pos</span> and <span class="RktVar">end-pos</span> arguments select
a portion of <span class="RktVar">input</span> for matching; the default is the entire
string or the stream up to an end-of-file.</p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replace%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-replace*</a></span><span class="hspace"> </span><span class="RktVal">#rx"([Mm])i ([a-zA-Z]*)"</span><span class="hspace"> </span><span class="RktVal">"mi cerveza Mi Mi Mi"</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">"\\1y \\2"</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">"my cerveza My Mi Mi"</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replace%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-replace*</a></span><span class="hspace"> </span><span class="RktVal">#rx"([Mm])i ([a-zA-Z]*)"</span><span class="hspace"> </span><span class="RktVal">"mi cerveza Mi Mi Mi"</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="lambda.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._lambda%29%29" class="RktStxLink" data-pltdoc="x">lambda</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym">all</span><span class="hspace"> </span><span class="RktSym">one</span><span class="hspace"> </span><span class="RktSym">two</span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string-append%29%29" class="RktValLink" data-pltdoc="x">string-append</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string-downcase%29%29" class="RktValLink" data-pltdoc="x">string-downcase</a></span><span class="hspace"> </span><span class="RktSym">one</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktVal">"y"</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string-upcase%29%29" class="RktValLink" data-pltdoc="x">string-upcase</a></span><span class="hspace"> </span><span class="RktSym">two</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">"myCERVEZA myMI Mi"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replace%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-replace*</a></span><span class="hspace"> </span><span class="RktVal">#px"\\w"</span><span class="hspace"> </span><span class="RktVal">"hello world"</span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string-upcase%29%29" class="RktValLink" data-pltdoc="x">string-upcase</a></span><span class="hspace"> </span><span class="RktVal">0</span><span class="hspace"> </span><span class="RktVal">5</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"HELLO world"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="Writing.html#%28def._%28%28quote._~23~25kernel%29._display%29%29" class="RktValLink" data-pltdoc="x">display</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replace%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-replace*</a></span><span class="hspace"> </span><span class="RktVal">#rx"x"</span><span class="hspace"> </span><span class="RktVal">"12x4x6"</span><span class="hspace"> </span><span class="RktVal">"\\\\"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktOut">12\4\6</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/private/base..rkt)._regexp-replaces))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replaces%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-replaces</a></span></span><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span><span class="RktVar">replacements</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">input</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="argcontract"><tr><td valign="top"><span class="hspace"> </span></td><td valign="top"><span class="RktVar">replacements</span></td><td valign="top"><span class="hspace"> </span></td><td valign="top">:</td><td valign="top"><span class="hspace"> </span></td><td valign="top"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._list%2Fc%29%29" class="RktValLink" data-pltdoc="x">list/c</a></span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp~3f%29%29" class="RktValLink" data-pltdoc="x">regexp?</a></span><span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._byte-regexp~3f%29%29" class="RktValLink" data-pltdoc="x">byte-regexp?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._or%2Fc%29%29" class="RktValLink" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">(</span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">#:rest</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%2A%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span>*</a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span><span class="RktPn">)</span></td></tr><tr><td><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">(</span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">#:rest</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="data-structure-contracts.html#%28def._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._listof%29%29" class="RktValLink" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span><span class="hspace"> </span><span class="RktPn">. </span><span class="RktSym"><a href="function-contracts.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._-~3e%2A%29%29" class="RktStxLink" data-pltdoc="x"><span class="nobreak">-></span>*</a></span><span class="RktPn"> .</span><span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr></table></td></tr></table></td></tr></table></blockquote></div><div class="SIntrapara">Performs a chain of <span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replace%2A%29%29" class="RktValLink" data-pltdoc="x">regexp-replace*</a></span> operations, where each
element in <span class="RktVar">replacements</span> specifies a replacement as a
<span class="RktPn">(</span><span class="RktSym"><a href="pairs.html#%28def._%28%28quote._~23~25kernel%29._list%29%29" class="RktValLink" data-pltdoc="x">list</a></span><span class="stt"> </span><span class="RktSym">pattern</span><span class="stt"> </span><span class="RktSym">replacement</span><span class="RktPn">)</span>. The replacements are done in
order, so later replacements can apply to previous insertions.</div></p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replaces%29%29" class="RktValLink" data-pltdoc="x">regexp-replaces</a></span><span class="hspace"> </span><span class="RktVal">"zero-or-more?"</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">[</span><span class="RktVal">#rx"-"</span><span class="hspace"> </span><span class="RktVal">"_"</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">#rx"(.*)\\?$"</span><span class="hspace"> </span><span class="RktVal">"is_\\1"</span><span class="RktVal">]</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">"is_zero_or_more"</span></p></td></tr><tr><td><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replaces%29%29" class="RktValLink" data-pltdoc="x">regexp-replaces</a></span><span class="hspace"> </span><span class="RktVal">"zero-or-more?"</span></td></tr><tr><td><span class="hspace"> </span><span class="hspace"> </span><span class="RktVal">'</span><span class="RktVal">(</span><span class="RktVal">[</span><span class="RktVal">#rx"e"</span><span class="hspace"> </span><span class="RktVal">"o"</span><span class="RktVal">]</span><span class="hspace"> </span><span class="RktVal">[</span><span class="RktVal">#rx"o"</span><span class="hspace"> </span><span class="RktVal">"oo"</span><span class="RktVal">]</span><span class="RktVal">)</span><span class="RktPn">)</span></td></tr></table></td></tr><tr><td><p><span class="RktRes">"zooroo-oor-mooroo?"</span></p></td></tr></table></blockquote></div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._racket/private/base..rkt)._regexp-replace-quote))"></a><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replace-quote%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-replace-quote</a></span></span><span class="hspace"> </span><span class="RktVar">str</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="strings.html#%28def._%28%28quote._~23~25kernel%29._string~3f%29%29" class="RktValLink" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: racket/base, racket | Package: base"><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replace-quote%29%29" class="RktValDef RktValLink" data-pltdoc="x">regexp-replace-quote</a></span></span><span class="hspace"> </span><span class="RktVar">bstr</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">bstr</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="bytestrings.html#%28def._%28%28quote._~23~25kernel%29._bytes~3f%29%29" class="RktValLink" data-pltdoc="x">bytes?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Produces a string suitable for use as the third argument to
<span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-replace%29%29" class="RktValLink" data-pltdoc="x">regexp-replace</a></span> to insert the literal sequence of characters
in <span class="RktVar">str</span> or bytes in <span class="RktVar">bstr</span> as a replacement.
Concretely, every <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span> and <span class="RktInBG"><span class="hspace"></span><span class="RktIn">&</span><span class="hspace"></span></span> in <span class="RktVar">str</span> or
<span class="RktVar">bstr</span> is protected by a quoting <span class="RktInBG"><span class="hspace"></span><span class="RktIn">\</span><span class="hspace"></span></span>.</div></p><p><div class="SIntrapara">Examples:</div><div class="SIntrapara"><blockquote class="SCodeFlow"><table cellspacing="0" cellpadding="0" class="RktBlk"><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-replace%29%29" class="RktValLink" data-pltdoc="x">regexp-replace</a></span><span class="hspace"> </span><span class="RktVal">#rx"UT"</span><span class="hspace"> </span><span class="RktVal">"Go UT!"</span><span class="hspace"> </span><span class="RktVal">"A&M"</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"Go AUTM!"</span></p></td></tr><tr><td><span class="stt">> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28quote._~23~25kernel%29._regexp-replace%29%29" class="RktValLink" data-pltdoc="x">regexp-replace</a></span><span class="hspace"> </span><span class="RktVal">#rx"UT"</span><span class="hspace"> </span><span class="RktVal">"Go UT!"</span><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._regexp-replace-quote%29%29" class="RktValLink" data-pltdoc="x">regexp-replace-quote</a></span><span class="hspace"> </span><span class="RktVal">"A&M"</span><span class="RktPn">)</span><span class="RktPn">)</span></td></tr><tr><td><p><span class="RktRes">"Go A&M!"</span></p></td></tr></table></blockquote></div></p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.7", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.7");">top</a></span><span class="navright"> <a href="symbols.html" title="backward to "4.6 Symbols"" data-pltdoc="x">← prev</a> <a href="data.html" title="up to "4 Datatypes"" data-pltdoc="x">up</a> <a href="keywords.html" title="forward to "4.8 Keywords"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|