summaryrefslogtreecommitdiff
path: root/manual.html
blob: 8acf6b2a83be57ea50e554b167a38c94fa9086c5 (plain)
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<title>Lrexlib Reference Manual</title>
<link rel="stylesheet" href="lrexlib.css" type="text/css" />
</head>
<body>
<div class="document" id="lrexlib-reference-manual">
<h1 class="title">Lrexlib Reference Manual</h1>

<div class="contents topic" id="table-of-contents">
<p class="topic-title first">Table of Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#notes" id="id16">Notes</a></li>
<li><a class="reference internal" href="#functions-and-methods-common-to-all-bindings" id="id17">Functions and methods common to all bindings</a><ul>
<li><a class="reference internal" href="#match" id="id18">match</a></li>
<li><a class="reference internal" href="#find" id="id19">find</a></li>
<li><a class="reference internal" href="#gmatch" id="id20">gmatch</a></li>
<li><a class="reference internal" href="#gsub" id="id21">gsub</a></li>
<li><a class="reference internal" href="#split" id="id22">split</a></li>
<li><a class="reference internal" href="#count" id="id23">count</a></li>
<li><a class="reference internal" href="#flags" id="id24">flags</a></li>
<li><a class="reference internal" href="#new" id="id25">new</a></li>
<li><a class="reference internal" href="#tfind" id="id26">tfind</a></li>
<li><a class="reference internal" href="#exec" id="id27">exec</a></li>
</ul>
</li>
<li><a class="reference internal" href="#pcre-only-functions-and-methods" id="id28">PCRE-only functions and methods</a><ul>
<li><a class="reference internal" href="#id1" id="id29">new</a></li>
<li><a class="reference internal" href="#fullinfo" id="id30">fullinfo</a></li>
<li><a class="reference internal" href="#dfa-exec" id="id31">dfa_exec</a></li>
<li><a class="reference internal" href="#maketables" id="id32">maketables</a></li>
<li><a class="reference internal" href="#config" id="id33">config</a></li>
<li><a class="reference internal" href="#id3" id="id34">version</a></li>
</ul>
</li>
<li><a class="reference internal" href="#pcre2-only-functions-and-methods" id="id35">PCRE2-only functions and methods</a><ul>
<li><a class="reference internal" href="#id4" id="id36">new</a></li>
<li><a class="reference internal" href="#patterninfo" id="id37">patterninfo</a></li>
<li><a class="reference internal" href="#id6" id="id38">dfa_exec</a></li>
<li><a class="reference internal" href="#jit-compile" id="id39">jit_compile</a></li>
<li><a class="reference internal" href="#id7" id="id40">maketables</a></li>
<li><a class="reference internal" href="#id8" id="id41">config</a></li>
<li><a class="reference internal" href="#id9" id="id42">version</a></li>
</ul>
</li>
<li><a class="reference internal" href="#gnu-only-functions-and-methods" id="id43">GNU-only functions and methods</a><ul>
<li><a class="reference internal" href="#id10" id="id44">new</a></li>
</ul>
</li>
<li><a class="reference internal" href="#oniguruma-only-functions-and-methods" id="id45">Oniguruma-only functions and methods</a><ul>
<li><a class="reference internal" href="#id11" id="id46">new</a></li>
<li><a class="reference internal" href="#setdefaultsyntax" id="id47">setdefaultsyntax</a></li>
<li><a class="reference internal" href="#id12" id="id48">version</a></li>
<li><a class="reference internal" href="#capturecount" id="id49">capturecount</a></li>
</ul>
</li>
<li><a class="reference internal" href="#tre-only-functions-and-methods" id="id50">TRE-only functions and methods</a><ul>
<li><a class="reference internal" href="#id13" id="id51">new</a></li>
<li><a class="reference internal" href="#atfind" id="id52">atfind</a></li>
<li><a class="reference internal" href="#aexec" id="id53">aexec</a></li>
<li><a class="reference internal" href="#have-approx" id="id54">have_approx</a></li>
<li><a class="reference internal" href="#have-backrefs" id="id55">have_backrefs</a></li>
<li><a class="reference internal" href="#id14" id="id56">config</a></li>
<li><a class="reference internal" href="#rex-tre-version" id="id57">rex_tre.version</a></li>
</ul>
</li>
<li><a class="reference internal" href="#incompatibilities-with-previous-versions" id="id58">Incompatibilities with previous versions</a></li>
</ul>
</div>
<hr class="docutils" />
<p><strong>Lrexlib</strong> builds into shared libraries called by default <em>rex_posix.so</em>,
<em>rex_pcre.so</em>, <em>rex_pcre2.so</em>, <em>rex_gnu.so</em>, <em>rex_tre.so</em> and <em>rex_onig.so</em>,
which can be used with <em>require</em>.</p>
<hr class="docutils" />
<div class="section" id="notes">
<h2><a class="toc-backref" href="#id16">Notes</a></h2>
<ol class="arabic">
<li><p class="first">Most functions and methods in Lrexlib have mandatory and optional arguments.
There are no dependencies between arguments in Lrexlib's functions and
methods. Any optional argument can be supplied as <tt class="docutils literal">nil</tt> (or omitted if it
is a trailing argument), the library will then use the default value for that
argument.</p>
</li>
<li><p class="first">This document uses the following syntax for optional arguments: they are
bracketed separately, and commas are left outside brackets, e.g.:</p>
<pre class="literal-block">
MyFunc (arg1, arg2, [arg3], [arg4])
</pre>
</li>
<li><p class="first">Throughout this document (unless it causes ambiguity), the identifier <strong>rex</strong>
is used in place of either <em>rex_posix</em>, <em>rex_pcre</em>, <em>rex_pcre2</em>, <em>rex_gnu</em>,
<em>rex_onig</em> or <em>rex_tre</em>, which are the default namespaces for the corresponding
libraries.</p>
</li>
<li><p class="first">All functions that take a regular expression pattern as an argument will
generate an error if that pattern is found invalid by the regex library.</p>
</li>
<li><p class="first">All functions that take a string-type regex argument accept a compiled regex
too. In this case, the <a class="reference internal" href="#cf">cf</a> and <a class="reference internal" href="#larg">larg</a> arguments are ignored (should
be either supplied as nils or omitted).</p>
</li>
<li><p class="first">All functions that take a string-type subject accept a table or userdata that
has a <tt class="docutils literal">topointer</tt> method and <tt class="docutils literal">__len</tt> metamethod, and take the subject to
be a block of memory starting at the address returned by
<tt class="docutils literal">subject:topointer()</tt> and of length <tt class="docutils literal">#subject</tt>. This works with buffers
objects from the alien library (<a class="reference external" href="https://github.com/mascarenhas/alien">https://github.com/mascarenhas/alien</a>). Note
that special attention is needed with POSIX regex libraries that do not
support <tt class="docutils literal">REG_STARTEND</tt>, and hence need NUL-terminated subjects: the NUL is
not included in the string length, so alien buffers must be wrapped to report
a length that excludes the NUL.</p>
</li>
</ol>
<ol class="arabic" id="cf" start="7">
<li><p class="first">The default value for <em>compilation flags</em> (<em>cf</em>) that Lrexlib uses when
the parameter is not supplied or <tt class="docutils literal">nil</tt> is:</p>
<blockquote>
<ul class="simple">
<li><tt class="docutils literal">REG_EXTENDED</tt> for POSIX and TRE</li>
<li><tt class="docutils literal">0</tt> for PCRE and PCRE2</li>
<li><tt class="docutils literal">ONIG_OPTION_NONE</tt> for Oniguruma</li>
<li><tt class="docutils literal">SYNTAX_POSIX_EXTENDED</tt> for GNU</li>
</ul>
</blockquote>
<p><strong>PCRE</strong>, <strong>PCRE2</strong>, <strong>Oniguruma</strong>: <em>cf</em> may also be supplied as a string,
whose characters stand for compilation flags. Combinations of the following
characters (case sensitive) are supported:</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="19%" />
<col width="22%" />
<col width="22%" />
<col width="37%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head"><strong>Character</strong></th>
<th class="head"><strong>PCRE flag</strong></th>
<th class="head"><strong>PCRE2 flag</strong></th>
<th class="head"><strong>Oniguruma flag</strong></th>
</tr>
</thead>
<tbody valign="top">
<tr><td><strong>i</strong></td>
<td>PCRE_CASELESS</td>
<td>PCRE2_CASELESS</td>
<td>ONIG_OPTION_IGNORECASE</td>
</tr>
<tr><td><strong>m</strong></td>
<td>PCRE_MULTILINE</td>
<td>PCRE2_MULTILINE</td>
<td>ONIG_OPTION_NEGATE_SINGLELINE</td>
</tr>
<tr><td><strong>s</strong></td>
<td>PCRE_DOTALL</td>
<td>PCRE2_DOTALL</td>
<td>ONIG_OPTION_MULTILINE</td>
</tr>
<tr><td><strong>x</strong></td>
<td>PCRE_EXTENDED</td>
<td>PCRE2_EXTENDED</td>
<td>ONIG_OPTION_EXTEND</td>
</tr>
<tr><td><strong>U</strong></td>
<td>PCRE_UNGREEDY</td>
<td>PCRE2_UNGREEDY</td>
<td>n/a</td>
</tr>
<tr><td><strong>X</strong></td>
<td>PCRE_EXTRA</td>
<td>n/a</td>
<td>n/a</td>
</tr>
</tbody>
</table>
</blockquote>
</li>
</ol>
<ol class="arabic" id="ef" start="8">
<li><p class="first">The default value for <em>execution flags</em> (<em>ef</em>) that Lrexlib uses when
the parameter is not supplied or <tt class="docutils literal">nil</tt>, is:</p>
<blockquote>
<ul class="simple">
<li><tt class="docutils literal">0</tt> for standard POSIX regex library</li>
<li><tt class="docutils literal">REG_STARTEND</tt> for those POSIX regex libraries that support it, e.g. Spencer's</li>
<li><tt class="docutils literal">0</tt> for PCRE, PCRE2, Oniguruma and TRE</li>
</ul>
</blockquote>
</li>
</ol>
<ol class="arabic simple" id="larg" start="9">
<li>The notation <em>larg...</em> is used to indicate optional library-specific
arguments, which are documented in the <tt class="docutils literal">new</tt> method of each library.</li>
<li>In the functions searching for multiple matches (<tt class="docutils literal">gmatch</tt>, <tt class="docutils literal">gsub</tt>,
<tt class="docutils literal">split</tt>, <tt class="docutils literal">count</tt>) every empty match adjacent to the previous match
is discarded, e.g. <tt class="docutils literal"><span class="pre">rex.count(&quot;abc&quot;,&quot;.*&quot;)</span></tt> will return 1.</li>
</ol>
</div>
<hr class="docutils" />
<div class="section" id="functions-and-methods-common-to-all-bindings">
<h2><a class="toc-backref" href="#id17">Functions and methods common to all bindings</a></h2>
<div class="section" id="match">
<h3><a class="toc-backref" href="#id18">match</a></h3>
<p><tt class="funcdef docutils literal">rex.match (subj, patt, [init], [cf], [ef], <span class="pre">[larg...])</span></tt></p>
<p>or</p>
<p><tt class="funcdef docutils literal">r:match (subj, [init], [ef])</tt></p>
<p>The function searches for the first match of the regexp <em>patt</em> in the string
<em>subj</em>, starting from offset <em>init</em>, subject to flags <em>cf</em> and <em>ef</em>.</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="15%" />
<col width="51%" />
<col width="13%" />
<col width="21%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Parameter</th>
<th class="head">Description</th>
<th class="head">Type</th>
<th class="head">Default Value</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>r</td>
<td>regex object produced by new</td>
<td>userdata</td>
<td>n/a</td>
</tr>
<tr><td>subj</td>
<td>subject</td>
<td>string</td>
<td>n/a</td>
</tr>
<tr><td>patt</td>
<td>regular expression pattern</td>
<td>string
or
userdata</td>
<td>n/a</td>
</tr>
<tr><td>[init]</td>
<td>start offset in the subject
(can be negative)</td>
<td>number</td>
<td>1</td>
</tr>
<tr><td>[cf]</td>
<td>compilation flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#cf">cf</a></td>
</tr>
<tr><td>[ef]</td>
<td>execution flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#ef">ef</a></td>
</tr>
<tr><td>[larg...]</td>
<td>library-specific arguments</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</blockquote>
<dl class="docutils">
<dt><strong>Returns on success:</strong></dt>
<dd><ol class="first last arabic simple">
<li>All substring matches (&quot;captures&quot;), in the order they appear in the
pattern. <tt class="docutils literal">false</tt> is returned for sub-patterns that did not participate in
the match. If the pattern specified no captures then the whole matched
substring is returned.</li>
</ol>
</dd>
<dt><strong>Returns on failure:</strong></dt>
<dd><ol class="first last arabic simple">
<li><tt class="docutils literal">nil</tt></li>
</ol>
</dd>
</dl>
</div>
<hr class="docutils" />
<div class="section" id="find">
<h3><a class="toc-backref" href="#id19">find</a></h3>
<p><tt class="funcdef docutils literal">rex.find (subj, patt, [init], [cf], [ef], <span class="pre">[larg...])</span></tt></p>
<p>or</p>
<p><tt class="funcdef docutils literal">r:find (subj, [init], [ef])</tt></p>
<p>The function searches for the first match of the regexp <em>patt</em> in the string
<em>subj</em>, starting from offset <em>init</em>, subject to flags <em>cf</em> and <em>ef</em>.</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="15%" />
<col width="51%" />
<col width="13%" />
<col width="21%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Parameter</th>
<th class="head">Description</th>
<th class="head">Type</th>
<th class="head">Default Value</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>r</td>
<td>regex object produced by new</td>
<td>userdata</td>
<td>n/a</td>
</tr>
<tr><td>subj</td>
<td>subject</td>
<td>string</td>
<td>n/a</td>
</tr>
<tr><td>patt</td>
<td>regular expression pattern</td>
<td>string
or
userdata</td>
<td>n/a</td>
</tr>
<tr><td>[init]</td>
<td>start offset in the subject
(can be negative)</td>
<td>number</td>
<td>1</td>
</tr>
<tr><td>[cf]</td>
<td>compilation flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#cf">cf</a></td>
</tr>
<tr><td>[ef]</td>
<td>execution flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#ef">ef</a></td>
</tr>
<tr><td>[larg...]</td>
<td>library-specific arguments</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</blockquote>
<dl class="docutils">
<dt><strong>Returns on success:</strong></dt>
<dd><ol class="first last arabic simple">
<li>The start point of the match (a number).</li>
<li>The end point of the match (a number).</li>
<li>All substring matches (&quot;captures&quot;), in the order they appear in the
pattern. <tt class="docutils literal">false</tt> is returned for sub-patterns that did not participate in
the match.</li>
</ol>
</dd>
<dt><strong>Returns on failure:</strong></dt>
<dd><ol class="first last arabic simple">
<li><tt class="docutils literal">nil</tt></li>
</ol>
</dd>
</dl>
</div>
<hr class="docutils" />
<div class="section" id="gmatch">
<h3><a class="toc-backref" href="#id20">gmatch</a></h3>
<p><tt class="funcdef docutils literal">rex.gmatch (subj, patt, [cf], [ef], <span class="pre">[larg...])</span></tt></p>
<p>The function is intended for use in the <em>generic for</em> Lua construct.
It returns an iterator for repeated matching of the pattern <em>patt</em> in
the string <em>subj</em>, subject to flags <em>cf</em> and <em>ef</em>.</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="15%" />
<col width="51%" />
<col width="13%" />
<col width="21%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Parameter</th>
<th class="head">Description</th>
<th class="head">Type</th>
<th class="head">Default Value</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>subj</td>
<td>subject</td>
<td>string</td>
<td>n/a</td>
</tr>
<tr><td>patt</td>
<td>regular expression pattern</td>
<td>string
or
userdata</td>
<td>n/a</td>
</tr>
<tr><td>[cf]</td>
<td>compilation flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#cf">cf</a></td>
</tr>
<tr><td>[ef]</td>
<td>execution flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#ef">ef</a></td>
</tr>
<tr><td>[larg...]</td>
<td>library-specific arguments</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</blockquote>
<p>The iterator function is called by Lua. On every iteration (that is, on every
match), it returns all captures in the order they appear in the pattern (or the
entire match if the pattern specified no captures). The iteration will continue
till the subject fails to match.</p>
</div>
<hr class="docutils" />
<div class="section" id="gsub">
<h3><a class="toc-backref" href="#id21">gsub</a></h3>
<p><tt class="funcdef docutils literal">rex.gsub (subj, patt, repl, [n], [cf], [ef], <span class="pre">[larg...])</span></tt></p>
<p>This function searches for all matches of the pattern <em>patt</em> in the string
<em>subj</em> and replaces them according to the parameters <em>repl</em> and <em>n</em> (see details
below).</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="11%" />
<col width="42%" />
<col width="31%" />
<col width="16%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Parameter</th>
<th class="head">Description</th>
<th class="head">Type</th>
<th class="head">Default Value</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>subj</td>
<td>subject</td>
<td>string</td>
<td>n/a</td>
</tr>
<tr><td>patt</td>
<td>regular expression pattern</td>
<td>string or userdata</td>
<td>n/a</td>
</tr>
<tr><td>repl</td>
<td>substitution source</td>
<td>string, function or table</td>
<td>n/a</td>
</tr>
<tr><td>[n]</td>
<td>maximum number of matches to search
for, or control function, or nil</td>
<td>number or function</td>
<td><tt class="docutils literal">nil</tt></td>
</tr>
<tr><td>[cf]</td>
<td>compilation flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#cf">cf</a></td>
</tr>
<tr><td>[ef]</td>
<td>execution flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#ef">ef</a></td>
</tr>
<tr><td>[larg...]</td>
<td>library-specific arguments</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</blockquote>
<dl class="docutils">
<dt><strong>Returns:</strong></dt>
<dd><ol class="first last arabic simple">
<li>The subject string with the substitutions made.</li>
<li>Number of matches found.</li>
<li>Number of substitutions made.</li>
</ol>
</dd>
<dt><strong>Details:</strong></dt>
<dd><p class="first">The parameter <em>repl</em> can be either a string, a function or a table.
On each match made, it is converted into a value <em>repl_out</em> that may be used
for the replacement.</p>
<p><em>repl_out</em> is generated differently depending on the type of <em>repl</em>:</p>
<ol class="arabic simple">
<li>If <em>repl</em> is a <em>string</em> then it is treated as a template for substitution,
where the %X occurences in <em>repl</em> are handled in a special way, depending
on the value of the character X:</li>
</ol>
<blockquote>
<ul class="simple">
<li>if X represents a digit, then each %X occurence is substituted by the
value of the X-th submatch (capture), with the following cases handled
specially:<ul>
<li>each %0 is substituted by the entire match</li>
<li>if the pattern contains no captures, then each %1 is substituted by the
entire match</li>
<li>any other %X where X is greater than the number of captures in the
pattern will generate an error (&quot;invalid capture index&quot;)</li>
<li>if the pattern does contain a capture with number X but that capture
didn't participate in the match, then %X is substituted by an empty
string</li>
</ul>
</li>
<li>if X is any non-digit character then %X is substituted by X</li>
</ul>
<p>All parts of <em>repl</em> other than %X are copied to <em>repl_out</em> verbatim.</p>
</blockquote>
<ol class="arabic simple" start="2">
<li>If <em>repl</em> is a <em>function</em> then it is called on each match with the
submatches passed as parameters (if there are no submatches then the entire
match is passed as the only parameter). <em>repl_out</em> is the return value of
the <em>repl</em> call, and is interpreted as follows:</li>
</ol>
<blockquote>
<ul class="simple">
<li>if it is a string or a number (coerced to a string), then the replacement
value is that string;</li>
<li>if it is a <tt class="docutils literal">nil</tt> or a <tt class="docutils literal">false</tt>, then no replacement is to be done;</li>
</ul>
</blockquote>
<ol class="arabic simple" start="3">
<li>If <em>repl</em> is a table then <em>repl_out</em> is <em>repl</em> [m1], where m1 is the first
submatch (or the entire match if there are no submatches), following the
same rules as for the return value of <em>repl</em> call, described in the above
paragraph.</li>
</ol>
<p>Note: Under some circumstances, the value of <em>repl_out</em> may be ignored; see
<a class="reference internal" href="#below">below</a>.</p>
<p>gsub behaves differently depending on the type of <em>n</em>:</p>
<ol class="last arabic simple">
<li>If <em>n</em> is a <em>number</em> then it is treated as the maximum number of matches
to search for (an omitted or <tt class="docutils literal">nil</tt> value means an unlimited number of
matches). On each match, the replacement value is the <em>repl_out</em> string
(see above).</li>
</ol>
</dd>
</dl>
<blockquote id="below">
<ol class="arabic" start="2">
<li><p class="first">If <em>n</em> is a function, then it is called on each match, after <em>repl_out</em> is
produced (so if <em>repl</em> is a function, it will be called prior to the <em>n</em>
call).</p>
<p><em>n</em> receives 3 arguments and returns 2 values. Its arguments are:</p>
<blockquote>
<ol class="arabic simple">
<li>The start offset of the match (a number)</li>
<li>The end offset of the match (a number)</li>
<li><em>repl_out</em></li>
</ol>
</blockquote>
<p>The type of its first return controls the replacement produced by gsub for
the current match:</p>
<blockquote>
<ul class="simple">
<li><tt class="docutils literal">true</tt> -- replace/don't replace, according to <em>repl_out</em>;</li>
<li><tt class="docutils literal">nil</tt>/<tt class="docutils literal">false</tt> -- don't replace;</li>
<li>a string (or a number coerced to a string) -- replace by that string;</li>
</ul>
</blockquote>
<p>The type of its second return controls gsub behavior after the current
match is handled:</p>
<blockquote>
<ul class="simple">
<li><tt class="docutils literal">nil</tt>/<tt class="docutils literal">false</tt> -- no changes: <em>n</em> will be called on the next match;</li>
<li><tt class="docutils literal">true</tt> -- search for an unlimited number of matches; <em>n</em> will not be
called again;</li>
<li>a number -- maximum number of matches to search for, beginning from the
next match; <em>n</em> will not be called again;</li>
</ul>
</blockquote>
</li>
</ol>
</blockquote>
</div>
<hr class="docutils" />
<div class="section" id="split">
<h3><a class="toc-backref" href="#id22">split</a></h3>
<p><tt class="funcdef docutils literal">rex.split (subj, sep, [cf], [ef], <span class="pre">[larg...])</span></tt></p>
<p>The function is intended for use in the <em>generic for</em> Lua construct.
It is used for splitting a subject string <em>subj</em> into parts (<em>sections</em>).
The <em>sep</em> parameter is a regular expression pattern representing
<strong>separators</strong> between the sections.</p>
<p>The function returns an iterator for repeated matching of the pattern <em>sep</em> in
the string <em>subj</em>, subject to flags <em>cf</em> and <em>ef</em>.</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="15%" />
<col width="51%" />
<col width="13%" />
<col width="21%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Parameter</th>
<th class="head">Description</th>
<th class="head">Type</th>
<th class="head">Default Value</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>subj</td>
<td>subject</td>
<td>string</td>
<td>n/a</td>
</tr>
<tr><td>sep</td>
<td>separator (regular expression
pattern)</td>
<td>string
or
userdata</td>
<td>n/a</td>
</tr>
<tr><td>[cf]</td>
<td>compilation flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#cf">cf</a></td>
</tr>
<tr><td>[ef]</td>
<td>execution flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#ef">ef</a></td>
</tr>
<tr><td>[larg...]</td>
<td>library-specific arguments</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</blockquote>
<p><strong>On every iteration pass, the iterator returns:</strong></p>
<blockquote>
<ol class="arabic simple">
<li>A subject section (can be an empty string), followed by</li>
<li>All captures in the order they appear in the <em>sep</em> pattern (or the entire
match if the <em>sep</em> pattern specified no captures). If there is no match
(this can occur only in the last iteration), then nothing is returned after
the subject section.</li>
</ol>
</blockquote>
<p>The iteration will continue till the end of the subject. Unlike <a class="reference internal" href="#gmatch">gmatch</a>, there
will always be at least one iteration pass, even if there are no matches in the
subject.</p>
</div>
<hr class="docutils" />
<div class="section" id="count">
<h3><a class="toc-backref" href="#id23">count</a></h3>
<p><tt class="funcdef docutils literal">rex.count (subj, patt, [cf], [ef], <span class="pre">[larg...])</span></tt></p>
<p>This function counts matches of the pattern <em>patt</em> in the string <em>subj</em>.</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="11%" />
<col width="42%" />
<col width="31%" />
<col width="16%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Parameter</th>
<th class="head">Description</th>
<th class="head">Type</th>
<th class="head">Default Value</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>subj</td>
<td>subject</td>
<td>string</td>
<td>n/a</td>
</tr>
<tr><td>patt</td>
<td>regular expression pattern</td>
<td>string or userdata</td>
<td>n/a</td>
</tr>
<tr><td>[cf]</td>
<td>compilation flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#cf">cf</a></td>
</tr>
<tr><td>[ef]</td>
<td>execution flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#ef">ef</a></td>
</tr>
<tr><td>[larg...]</td>
<td>library-specific arguments</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</blockquote>
<dl class="docutils">
<dt><strong>Returns:</strong></dt>
<dd><ol class="first last arabic simple">
<li>Number of matches found.</li>
</ol>
</dd>
</dl>
</div>
<hr class="docutils" />
<div class="section" id="flags">
<h3><a class="toc-backref" href="#id24">flags</a></h3>
<p><tt class="funcdef docutils literal">rex.flags ([tb])</tt></p>
<p>This function returns a table containing the numeric values of the constants
defined by the used regex library, with the keys being the (string) names of the
constants. If the table argument <em>tb</em> is supplied then it is used as the output
table, otherwise a new table is created.</p>
<p>The constants contained in the returned table can then be used in most functions
and methods where <em>compilation flags</em> or <em>execution flags</em> can be specified.
They can also be used for comparing with return codes of some functions and
methods for determining the reason of failure. For details, see the relevant
regex library's documentation.</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="15%" />
<col width="52%" />
<col width="13%" />
<col width="21%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Parameter</th>
<th class="head">Description</th>
<th class="head">Type</th>
<th class="head">Default Value</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>[tb]</td>
<td>a table for placing results into</td>
<td>table</td>
<td><tt class="docutils literal">nil</tt></td>
</tr>
</tbody>
</table>
</blockquote>
<dl class="docutils">
<dt><strong>Returns:</strong></dt>
<dd><ol class="first last arabic simple">
<li>A table filled with the results.</li>
</ol>
</dd>
</dl>
<p><strong>Notes:</strong>
The keys in the <cite>tb</cite> table are formed from the names of the corresponding
constants in the used library. They are formed as follows:</p>
<ul class="simple">
<li><strong>POSIX</strong>, <strong>TRE</strong>: prefix REG_ is omitted, e.g. REG_ICASE becomes <tt class="docutils literal">&quot;ICASE&quot;</tt>.</li>
<li><strong>PCRE:</strong> prefix PCRE_ is omitted, e.g. PCRE_CASELESS becomes <tt class="docutils literal">&quot;CASELESS&quot;</tt>.</li>
<li><strong>PCRE2:</strong> prefix PCRE2_ is omitted, e.g. PCRE2_CASELESS becomes <tt class="docutils literal">&quot;CASELESS&quot;</tt>.</li>
<li><strong>Oniguruma:</strong> names of constants are converted to strings with no alteration,
but for ONIG_OPTION_xxx constants, alias strings are created additionally,
e.g., the value of ONIG_OPTION_IGNORECASE constant becomes accessible via
either of two keys: <tt class="docutils literal">&quot;ONIG_OPTION_IGNORECASE&quot;</tt> and <tt class="docutils literal">&quot;IGNORECASE&quot;</tt>.</li>
<li><strong>GNU</strong>: the GNU library provides the flags <tt class="docutils literal">not_bol</tt>, which stops a
beginning-of-line anchor from matching at the start of a string, <tt class="docutils literal">not_eol</tt>,
which stops an end-of-line anchor from matching at the end of a string, and
<tt class="docutils literal">backward</tt> which causes the search to be performed backwards (that is, the
pattern is matched from positions starting at the end of the string; however,
the matches themselves are still made forwards), as well as the RE_xxx syntax
specifiers (as defined in regex.h), omitting the RE_ prefix. For example,
RE_SYNTAX_GREP becomes <tt class="docutils literal">SYNTAX_GREP</tt> in Lua.</li>
</ul>
</div>
<hr class="docutils" />
<div class="section" id="new">
<h3><a class="toc-backref" href="#id25">new</a></h3>
<p><tt class="funcdef docutils literal">rex.new (patt, [cf], <span class="pre">[larg...])</span></tt></p>
<p>The function compiles regular expression <em>patt</em> into a regular expression object
whose internal representation is corresponding to the library used. The returned
result then can be used by the methods, e.g. <a class="reference internal" href="#tfind">tfind</a>, <a class="reference internal" href="#exec">exec</a>, etc. Regular
expression objects are automatically garbage collected. See the library-specific
documentation below for details of the library-specific arguments <em>larg...</em>, if
any.</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="15%" />
<col width="51%" />
<col width="13%" />
<col width="21%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Parameter</th>
<th class="head">Description</th>
<th class="head">Type</th>
<th class="head">Default Value</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>patt</td>
<td>regular expression pattern</td>
<td>string</td>
<td>n/a</td>
</tr>
<tr><td>[cf]</td>
<td>compilation flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#cf">cf</a></td>
</tr>
<tr><td>[larg...]</td>
<td>library-specific arguments</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</blockquote>
<dl class="docutils">
<dt><strong>Returns:</strong></dt>
<dd><ol class="first last arabic simple">
<li>Compiled regular expression (a userdata).</li>
</ol>
</dd>
</dl>
</div>
<hr class="docutils" />
<div class="section" id="tfind">
<h3><a class="toc-backref" href="#id26">tfind</a></h3>
<p><tt class="funcdef docutils literal">r:tfind (subj, [init], [ef])</tt></p>
<p>The method searches for the first match of the compiled regexp <em>r</em> in the
string <em>subj</em>, starting from offset <em>init</em>, subject to execution flags <em>ef</em>.</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="14%" />
<col width="54%" />
<col width="12%" />
<col width="20%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Parameter</th>
<th class="head">Description</th>
<th class="head">Type</th>
<th class="head">Default Value</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>r</td>
<td>regex object produced by new</td>
<td>userdata</td>
<td>n/a</td>
</tr>
<tr><td>subj</td>
<td>subject</td>
<td>string</td>
<td>n/a</td>
</tr>
<tr><td>[init]</td>
<td>start offset in the subject
(can be negative)</td>
<td>number</td>
<td>1</td>
</tr>
<tr><td>[ef]</td>
<td>execution flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#ef">ef</a></td>
</tr>
</tbody>
</table>
</blockquote>
<dl class="docutils">
<dt><strong>Returns on success:</strong></dt>
<dd><ol class="first last arabic simple">
<li>The start point of the match (a number).</li>
<li>The end point of the match (a number).</li>
<li>Substring matches (&quot;captures&quot; in Lua terminology) are returned as a third
result, in a table. This table contains <tt class="docutils literal">false</tt> in the positions where the
corresponding sub-pattern did not participate in the match.<ol class="arabic">
<li><strong>PCRE</strong>, <strong>PCRE2</strong>, <strong>Oniguruma</strong>: if <em>named subpatterns</em> are used then
the table also contains substring matches keyed by their correspondent
subpattern names (strings).</li>
</ol>
</li>
</ol>
</dd>
<dt><strong>Returns on failure:</strong></dt>
<dd><ol class="first last arabic simple">
<li><tt class="docutils literal">nil</tt></li>
</ol>
</dd>
</dl>
</div>
<hr class="docutils" />
<div class="section" id="exec">
<h3><a class="toc-backref" href="#id27">exec</a></h3>
<p><tt class="funcdef docutils literal">r:exec (subj, [init], [ef])</tt></p>
<p>The method searches for the first match of the compiled regexp <em>r</em> in the
string <em>subj</em>, starting from offset <em>init</em>, subject to execution flags <em>ef</em>.</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="14%" />
<col width="54%" />
<col width="12%" />
<col width="20%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Parameter</th>
<th class="head">Description</th>
<th class="head">Type</th>
<th class="head">Default Value</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>r</td>
<td>regex object produced by new</td>
<td>userdata</td>
<td>n/a</td>
</tr>
<tr><td>subj</td>
<td>subject</td>
<td>string</td>
<td>n/a</td>
</tr>
<tr><td>[init]</td>
<td>start offset in the subject
(can be negative)</td>
<td>number</td>
<td>1</td>
</tr>
<tr><td>[ef]</td>
<td>execution flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#ef">ef</a></td>
</tr>
</tbody>
</table>
</blockquote>
<dl class="docutils">
<dt><strong>Returns on success:</strong></dt>
<dd><ol class="first last arabic simple">
<li>The start point of the first match (a number).</li>
<li>The end point of the first match (a number).</li>
<li>The offsets of substring matches (&quot;captures&quot; in Lua terminology) are
returned as a third result, in a table. This table contains <tt class="docutils literal">false</tt> in the
positions where the corresponding sub-pattern did not participate in the
match.<ol class="arabic">
<li><strong>PCRE</strong>, <strong>PCRE2</strong>, <strong>Oniguruma</strong>: if <em>named subpatterns</em> are used then
the table also contains substring matches keyed by their correspondent
subpattern names (strings).</li>
</ol>
</li>
</ol>
</dd>
<dt><strong>Returns on failure:</strong></dt>
<dd><ol class="first last arabic simple">
<li><tt class="docutils literal">nil</tt></li>
</ol>
</dd>
<dt><strong>Example:</strong></dt>
<dd>If the whole match is at offsets 10,20 and substring matches are at offsets
12,14 and 16,19 then the function returns the following: 10, 20,
{ 12,14,16,19 }.</dd>
</dl>
</div>
</div>
<hr class="docutils" />
<div class="section" id="pcre-only-functions-and-methods">
<h2><a class="toc-backref" href="#id28">PCRE-only functions and methods</a></h2>
<div class="section" id="id1">
<h3><a class="toc-backref" href="#id29">new</a></h3>
<p><tt class="funcdef docutils literal">rex.new (patt, [cf], [lo])</tt></p>
<p>The locale (<em>lo</em>) can be either a string (e.g., &quot;French_France.1252&quot;), or a
userdata obtained from a call to <a class="reference internal" href="#maketables-pcre">maketables</a>. The default value, used when
the parameter is not supplied or <tt class="docutils literal">nil</tt>, is the built-in PCRE set of character
tables.</p>
</div>
<hr class="docutils" />
<div class="section" id="fullinfo">
<h3><a class="toc-backref" href="#id30">fullinfo</a></h3>
<p>[See <em>pcre_fullinfo</em> in the PCRE docs.]</p>
<p><tt class="funcdef docutils literal">r:fullinfo ()</tt></p>
<p>This function returns a table containing information about the compiled pattern.
The keys are strings formed in the following way:
<tt class="docutils literal">PCRE_INFO_CAPTURECOUNT</tt> -&gt; <tt class="docutils literal">&quot;CAPTURECOUNT&quot;</tt>. The values are numbers.</p>
<hr class="docutils" />
</div>
<div class="section" id="dfa-exec">
<span id="dfa-exec-pcre"></span><h3><a class="toc-backref" href="#id31">dfa_exec</a></h3>
<p>[PCRE 6.0 and later. See <em>pcre_dfa_exec</em> in the PCRE docs.]</p>
<p><tt class="funcdef docutils literal">r:dfa_exec (subj, [init], [ef], [ovecsize], [wscount])</tt></p>
<p>The method matches a compiled regular expression <em>r</em> against a given subject
string <em>subj</em>, using a DFA matching algorithm.</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="15%" />
<col width="54%" />
<col width="12%" />
<col width="19%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Parameter</th>
<th class="head">Description</th>
<th class="head">Type</th>
<th class="head">Default Value</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>r</td>
<td>regex object produced by new</td>
<td>userdata</td>
<td>n/a</td>
</tr>
<tr><td>subj</td>
<td>subject</td>
<td>string</td>
<td>n/a</td>
</tr>
<tr><td>[init]</td>
<td>start offset in the subject
(can be negative)</td>
<td>number</td>
<td>1</td>
</tr>
<tr><td>[ef]</td>
<td>execution flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#ef">ef</a></td>
</tr>
<tr><td>[ovecsize]</td>
<td>size of the array for result offsets</td>
<td>number</td>
<td>100</td>
</tr>
<tr><td>[wscount]</td>
<td>number of elements in the working
space array</td>
<td>number</td>
<td>50</td>
</tr>
</tbody>
</table>
</blockquote>
<dl class="docutils">
<dt><strong>Returns on success (either full or partial match):</strong></dt>
<dd><ol class="first last arabic simple">
<li>The start point of the matches found (a number).</li>
<li>A table containing the end points of the matches found, the longer matches
first.</li>
<li>The return value of the underlying <em>pcre_dfa_exec</em> call (a number).</li>
</ol>
</dd>
<dt><strong>Returns on failure (no match):</strong></dt>
<dd><ol class="first last arabic simple">
<li><tt class="docutils literal">nil</tt></li>
</ol>
</dd>
<dt><strong>Example:</strong></dt>
<dd>If there are 3 matches found starting at offset 10 and ending at offsets 15, 20
and 25 then the function returns the following: 10, { 25,20,15 }, 3.</dd>
</dl>
<hr class="docutils" />
</div>
<div class="section" id="maketables">
<span id="maketables-pcre"></span><h3><a class="toc-backref" href="#id32">maketables</a></h3>
<p>[See <em>pcre_maketables</em> in the PCRE docs.]</p>
<p><tt class="funcdef docutils literal">rex_pcre.maketables ()</tt></p>
<p>Creates a set of character tables corresponding to the current locale and
returns it as a userdata. The returned value can be passed to any Lrexlib
function accepting the <em>locale</em> parameter.</p>
</div>
<hr class="docutils" />
<div class="section" id="config">
<h3><a class="toc-backref" href="#id33">config</a></h3>
<p>[PCRE 4.0 and later. See <em>pcre_config</em> in the PCRE docs.]</p>
<p><tt class="funcdef docutils literal">rex_pcre.config ([tb])</tt></p>
<p>This function returns a table containing the values of the configuration
parameters used at PCRE library build-time. Those parameters (numbers) are
keyed by their names (strings). If the table argument <em>tb</em> is supplied then it
is used as the output table, else a new table is created.</p>
<hr class="docutils" />
</div>
<div class="section" id="id3">
<span id="version"></span><h3><a class="toc-backref" href="#id34">version</a></h3>
<p>[See <em>pcre_version</em> in the PCRE docs.]</p>
<p><tt class="funcdef docutils literal">rex_pcre.version ()</tt></p>
<p>This function returns a string containing the version of the used PCRE library
and its release date.</p>
</div>
</div>
<hr class="docutils" />
<div class="section" id="pcre2-only-functions-and-methods">
<h2><a class="toc-backref" href="#id35">PCRE2-only functions and methods</a></h2>
<div class="section" id="id4">
<h3><a class="toc-backref" href="#id36">new</a></h3>
<p><tt class="funcdef docutils literal">rex.new (patt, [cf], [lo])</tt></p>
<p>The locale (<em>lo</em>) can be either a string (e.g., &quot;French_France.1252&quot;), or a
userdata obtained from a call to <a class="reference internal" href="#maketables-pcre2">maketables</a>. The default value, used when
the parameter is not supplied or <tt class="docutils literal">nil</tt>, is the built-in PCRE2 set of character
tables.</p>
</div>
<hr class="docutils" />
<div class="section" id="patterninfo">
<h3><a class="toc-backref" href="#id37">patterninfo</a></h3>
<p>[See <em>pcre2_patterninfo</em> in the PCRE2 docs.]</p>
<p><tt class="funcdef docutils literal">r:patterninfo ()</tt></p>
<p>This function returns a table containing information about the compiled pattern.
The keys are strings formed in the following way:
<tt class="docutils literal">PCRE2_INFO_CAPTURECOUNT</tt> -&gt; <tt class="docutils literal">&quot;CAPTURECOUNT&quot;</tt>. The values are numbers.</p>
</div>
<hr class="docutils" />
<div class="section" id="id6">
<h3><a class="toc-backref" href="#id38">dfa_exec</a></h3>
<p>[See <em>pcre2_dfa_exec</em> in the PCRE2 docs.]</p>
<p><tt class="funcdef docutils literal">r:dfa_exec (subj, [init], [ef], [ovecsize], [wscount])</tt></p>
<p>The method matches a compiled regular expression <em>r</em> against a given subject
string <em>subj</em>, using a DFA matching algorithm.</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="15%" />
<col width="54%" />
<col width="12%" />
<col width="19%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Parameter</th>
<th class="head">Description</th>
<th class="head">Type</th>
<th class="head">Default Value</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>r</td>
<td>regex object produced by new</td>
<td>userdata</td>
<td>n/a</td>
</tr>
<tr><td>subj</td>
<td>subject</td>
<td>string</td>
<td>n/a</td>
</tr>
<tr><td>[init]</td>
<td>start offset in the subject
(can be negative)</td>
<td>number</td>
<td>1</td>
</tr>
<tr><td>[ef]</td>
<td>execution flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#ef">ef</a></td>
</tr>
<tr><td>[ovecsize]</td>
<td>size of the array for result offsets</td>
<td>number</td>
<td>100</td>
</tr>
<tr><td>[wscount]</td>
<td>number of elements in the working
space array</td>
<td>number</td>
<td>50</td>
</tr>
</tbody>
</table>
</blockquote>
<dl class="docutils">
<dt><strong>Returns on success (either full or partial match):</strong></dt>
<dd><ol class="first last arabic simple">
<li>The start point of the matches found (a number).</li>
<li>A table containing the end points of the matches found, the longer matches
first.</li>
<li>The return value of the underlying <em>pcre_dfa_exec</em> call (a number).</li>
</ol>
</dd>
<dt><strong>Returns on failure (no match):</strong></dt>
<dd><ol class="first last arabic simple">
<li><tt class="docutils literal">nil</tt></li>
</ol>
</dd>
<dt><strong>Example:</strong></dt>
<dd>If there are 3 matches found starting at offset 10 and ending at offsets 15, 20
and 25 then the function returns the following: 10, { 25,20,15 }, 3.</dd>
</dl>
</div>
<hr class="docutils" />
<div class="section" id="jit-compile">
<h3><a class="toc-backref" href="#id39">jit_compile</a></h3>
<p>[See <em>pcre2_jit_compile</em> in the PCRE2 docs.]</p>
<p><tt class="funcdef docutils literal">r:jit_compile ([options])</tt></p>
<p>Parameter <em>options</em> is a number (a bitwise OR of separate options;
it defaults to <tt class="docutils literal">PCRE2_JIT_COMPLETE</tt>).</p>
<p>The method returns <tt class="docutils literal">true</tt> on success or <tt class="docutils literal">false</tt> + error message string on failure.</p>
<hr class="docutils" />
</div>
<div class="section" id="id7">
<span id="maketables-pcre2"></span><h3><a class="toc-backref" href="#id40">maketables</a></h3>
<p>[See <em>pcre2_maketables</em> in the PCRE2 docs.]</p>
<p><tt class="funcdef docutils literal">rex_pcre2.maketables ()</tt></p>
<p>Creates a set of character tables corresponding to the current locale and
returns it as a userdata. The returned value can be passed to any Lrexlib
function accepting the <em>locale</em> parameter.</p>
</div>
<hr class="docutils" />
<div class="section" id="id8">
<h3><a class="toc-backref" href="#id41">config</a></h3>
<p>[See <em>pcre2_config</em> in the PCRE2 docs.]</p>
<p><tt class="funcdef docutils literal">rex_pcre2.config ([tb])</tt></p>
<p>This function returns a table containing the values of the configuration
parameters used at PCRE2 library build-time. Those parameters (numbers) are
keyed by their names (strings). If the table argument <em>tb</em> is supplied then it
is used as the output table, else a new table is created.</p>
</div>
<hr class="docutils" />
<div class="section" id="id9">
<h3><a class="toc-backref" href="#id42">version</a></h3>
<p>[See <em>pcre2_config(PCRE2_CONFIG_VERSION)</em> in the PCRE2 docs.]</p>
<p><tt class="funcdef docutils literal">rex_pcre2.version ()</tt></p>
<p>This function returns a string containing the version of the used PCRE2 library
and its release date.</p>
</div>
</div>
<hr class="docutils" />
<div class="section" id="gnu-only-functions-and-methods">
<h2><a class="toc-backref" href="#id43">GNU-only functions and methods</a></h2>
<div class="section" id="id10">
<h3><a class="toc-backref" href="#id44">new</a></h3>
<p><tt class="funcdef docutils literal">rex.new (patt, [cf], [tr])</tt></p>
<p>If the compilation flags (<em>cf</em>) are not supplied or <tt class="docutils literal">nil</tt>, the default syntax
is <tt class="docutils literal">SYNTAX_POSIX_EXTENDED</tt>. Note that this is not the same as passing a value
of zero, which is the same as <tt class="docutils literal">SYNTAX_EMACS</tt>.</p>
<p>The <em>translation</em> parameter (<em>tr</em>) is a map of eight-bit character codes (0 to
255 inclusive) to 8-bit characters (strings). If this parameter is given, the
pattern is translated at compilation time, and each string to be matched is
translated when it is being matched.</p>
</div>
</div>
<div class="section" id="oniguruma-only-functions-and-methods">
<h2><a class="toc-backref" href="#id45">Oniguruma-only functions and methods</a></h2>
<div class="section" id="id11">
<h3><a class="toc-backref" href="#id46">new</a></h3>
<p><tt class="funcdef docutils literal">rex.new (patt, [cf], [enc], [syn])</tt></p>
<p>The <em>encoding</em> parameter (<em>enc</em>) must be one of the predefined strings that are
formed from the ONIG_ENCODING_xxx identifiers defined in oniguruma.h, by means
of omitting the ONIG_ENCODING_ part. For example, ONIG_ENCODING_UTF8 becomes
<tt class="docutils literal">&quot;UTF8&quot;</tt> on the Lua side. The default value, used when the parameter is not
supplied or <tt class="docutils literal">nil</tt>, is <tt class="docutils literal">&quot;ASCII&quot;</tt>.</p>
<p>If the caller-supplied value of this parameter is not one of the predefined
&quot;encoding&quot; string set, an error is raised.</p>
<p>The <em>syntax</em> parameter (<em>syn</em>) must be one of the predefined strings that are
formed from the ONIG_SYNTAX_xxx identifiers defined in oniguruma.h, by means of
omitting the ONIG_SYNTAX_ part. For example, ONIG_SYNTAX_JAVA becomes
<tt class="docutils literal">&quot;JAVA&quot;</tt> on the Lua side. The default value, used when the parameter is not
supplied or <tt class="docutils literal">nil</tt>, is either <tt class="docutils literal">&quot;RUBY&quot;</tt> (at start-up), or the value set by the
last <a class="reference internal" href="#setdefaultsyntax">setdefaultsyntax</a> call.</p>
<p>If the caller-supplied value of <cite>syntax</cite> parameter is not one of the predefined
&quot;syntax&quot; string set, an error is raised.</p>
</div>
<div class="section" id="setdefaultsyntax">
<h3><a class="toc-backref" href="#id47">setdefaultsyntax</a></h3>
<p><tt class="funcdef docutils literal">rex_onig.setdefaultsyntax (syntax)</tt></p>
<p>This function sets the default syntax for the Oniguruma library, according to the
value of the string syntax. The specified syntax will be further used for
interpreting string regex patterns by all relevant functions, unless the <em>syntax</em>
argument is passed to those functions explicitly.</p>
<p><strong>Returns:</strong> nothing</p>
<p><strong>Examples:</strong></p>
<blockquote>
<ol class="arabic simple">
<li><tt class="docutils literal">rex_onig.setdefaultsyntax (&quot;ASIS&quot;) <span class="pre">--</span> use plain text syntax as the default</tt></li>
<li><tt class="docutils literal">rex_onig.setdefaultsyntax (&quot;PERL&quot;) <span class="pre">--</span> use PERL regex syntax as the default</tt></li>
</ol>
</blockquote>
</div>
<hr class="docutils" />
<div class="section" id="id12">
<h3><a class="toc-backref" href="#id48">version</a></h3>
<p>[See <em>onig_version</em> in the Oniguruma docs.]</p>
<p><tt class="funcdef docutils literal">rex_onig.version ()</tt></p>
<p>This function returns a string containing the version of the used Oniguruma
library.</p>
</div>
<hr class="docutils" />
<div class="section" id="capturecount">
<h3><a class="toc-backref" href="#id49">capturecount</a></h3>
<p>[See <em>onig_number_of_captures</em> in the Oniguruma docs.]</p>
<p><tt class="funcdef docutils literal">r:capturecount ()</tt></p>
<p>Returns the number of captures in the pattern.</p>
</div>
</div>
<hr class="docutils" />
<div class="section" id="tre-only-functions-and-methods">
<h2><a class="toc-backref" href="#id50">TRE-only functions and methods</a></h2>
<div class="section" id="id13">
<h3><a class="toc-backref" href="#id51">new</a></h3>
<p><tt class="funcdef docutils literal">rex.new (patt, [cf])</tt></p>
</div>
<div class="section" id="atfind">
<h3><a class="toc-backref" href="#id52">atfind</a></h3>
<p><tt class="funcdef docutils literal">r:atfind (subj, params, [init], [ef])</tt></p>
<p>The method searches for the first match of the compiled regexp <em>r</em> in the
string <em>subj</em>, starting from offset <em>init</em>, subject to execution flags <em>ef</em>.</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="14%" />
<col width="54%" />
<col width="12%" />
<col width="20%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Parameter</th>
<th class="head">Description</th>
<th class="head">Type</th>
<th class="head">Default Value</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>r</td>
<td>regex object produced by new</td>
<td>userdata</td>
<td>n/a</td>
</tr>
<tr><td>subj</td>
<td>subject</td>
<td>string</td>
<td>n/a</td>
</tr>
<tr><td>params</td>
<td>Approximate matching parameters.
The values are integers.
The valid string key values are:
<tt class="docutils literal">cost_ins</tt>, <tt class="docutils literal">cost_del</tt>,
<tt class="docutils literal">cost_subst</tt>, <tt class="docutils literal">max_cost</tt>,
<tt class="docutils literal">max_ins</tt>, <tt class="docutils literal">max_del</tt>,
<tt class="docutils literal">max_subst</tt>, <tt class="docutils literal">max_err</tt></td>
<td>table</td>
<td><p class="first">n/a</p>
<p class="last">(Default
value for
a missing
field is 0)</p>
</td>
</tr>
<tr><td>[init]</td>
<td>start offset in the subject
(can be negative)</td>
<td>number</td>
<td>1</td>
</tr>
<tr><td>[ef]</td>
<td>execution flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#ef">ef</a></td>
</tr>
</tbody>
</table>
</blockquote>
<dl class="docutils">
<dt><strong>Returns on success:</strong></dt>
<dd><ol class="first last arabic simple">
<li>The start point of the match (a number).</li>
<li>The end point of the match (a number).</li>
<li>Substring matches (&quot;captures&quot; in Lua terminology) are returned as a third
result, in the array part of a table. Positions where the corresponding
sub-pattern did not participate in the match contain <tt class="docutils literal">false</tt>.
The hash part of the table contains additional information on the match,
in the following fields: <tt class="docutils literal">cost</tt>, <tt class="docutils literal">num_ins</tt>, <tt class="docutils literal">num_del</tt> and <tt class="docutils literal">num_subst</tt>.</li>
</ol>
</dd>
<dt><strong>Returns on failure:</strong></dt>
<dd><ol class="first last arabic simple">
<li><tt class="docutils literal">nil</tt></li>
</ol>
</dd>
</dl>
</div>
<hr class="docutils" />
<div class="section" id="aexec">
<h3><a class="toc-backref" href="#id53">aexec</a></h3>
<p><tt class="funcdef docutils literal">r:aexec (subj, params, [init], [ef])</tt></p>
<p>The method searches for the first match of the compiled regexp <em>r</em> in the
string <em>subj</em>, starting from offset <em>init</em>, subject to execution flags <em>ef</em>.</p>
<blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="14%" />
<col width="54%" />
<col width="12%" />
<col width="20%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Parameter</th>
<th class="head">Description</th>
<th class="head">Type</th>
<th class="head">Default Value</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>r</td>
<td>regex object produced by new</td>
<td>userdata</td>
<td>n/a</td>
</tr>
<tr><td>subj</td>
<td>subject</td>
<td>string</td>
<td>n/a</td>
</tr>
<tr><td>params</td>
<td>Approximate matching parameters.
The values are integers.
The valid string key values are:
<tt class="docutils literal">cost_ins</tt>, <tt class="docutils literal">cost_del</tt>,
<tt class="docutils literal">cost_subst</tt>, <tt class="docutils literal">max_cost</tt>,
<tt class="docutils literal">max_ins</tt>, <tt class="docutils literal">max_del</tt>,
<tt class="docutils literal">max_subst</tt>, <tt class="docutils literal">max_err</tt></td>
<td>table</td>
<td><p class="first">n/a</p>
<p class="last">(Default
value for
a missing
field is 0)</p>
</td>
</tr>
<tr><td>[init]</td>
<td>start offset in the subject
(can be negative)</td>
<td>number</td>
<td>1</td>
</tr>
<tr><td>[ef]</td>
<td>execution flags (bitwise OR)</td>
<td>number</td>
<td><a class="reference internal" href="#ef">ef</a></td>
</tr>
</tbody>
</table>
</blockquote>
<dl class="docutils">
<dt><strong>Returns on success:</strong></dt>
<dd><ol class="first last arabic simple">
<li>The start point of the first match (a number).</li>
<li>The end point of the first match (a number).</li>
<li>The offsets of substring matches (&quot;captures&quot; in Lua terminology) are
returned as a third result, in the array part of a table. Positions where
the corresponding sub-pattern did not participate in the match contain
<tt class="docutils literal">false</tt>. The hash part of the table contains additional information on
the match, in the following fields: <tt class="docutils literal">cost</tt>, <tt class="docutils literal">num_ins</tt>, <tt class="docutils literal">num_del</tt> and
<tt class="docutils literal">num_subst</tt>.</li>
</ol>
</dd>
<dt><strong>Returns on failure:</strong></dt>
<dd><ol class="first last arabic simple">
<li><tt class="docutils literal">nil</tt></li>
</ol>
</dd>
</dl>
</div>
<hr class="docutils" />
<div class="section" id="have-approx">
<h3><a class="toc-backref" href="#id54">have_approx</a></h3>
<p><tt class="funcdef docutils literal">r:have_approx ()</tt></p>
<p>The method returns <tt class="docutils literal">true</tt> if the compiled pattern uses approximate matching,
and <tt class="docutils literal">false</tt> if not.</p>
</div>
<hr class="docutils" />
<div class="section" id="have-backrefs">
<h3><a class="toc-backref" href="#id55">have_backrefs</a></h3>
<p><tt class="funcdef docutils literal">r:have_backrefs ()</tt></p>
<p>The method returns <tt class="docutils literal">true</tt> if the compiled pattern has back references,
and <tt class="docutils literal">false</tt> if not.</p>
</div>
<hr class="docutils" />
<div class="section" id="id14">
<h3><a class="toc-backref" href="#id56">config</a></h3>
<p>[See <em>tre_config</em> in the TRE docs.]</p>
<p><tt class="funcdef docutils literal">rex_tre.config ([tb])</tt></p>
<p>This function returns a table containing the values of the configuration
parameters used at TRE library build-time. Those parameters are
keyed by their names. If the table argument <em>tb</em> is supplied then it
is used as the output table, else a new table is created.</p>
</div>
<hr class="docutils" />
<div class="section" id="rex-tre-version">
<h3><a class="toc-backref" href="#id57">rex_tre.version</a></h3>
<p>[See <em>tre_version</em> in the TRE docs.]</p>
<p><tt class="funcdef docutils literal">rex_tre.version ()</tt></p>
<p>This function returns a string containing the version of the used TRE library.</p>
</div>
</div>
<hr class="docutils" />
<div class="section" id="incompatibilities-with-previous-versions">
<h2><a class="toc-backref" href="#id58">Incompatibilities with previous versions</a></h2>
<p><strong>Incompatibilities between versions 2.8 and 2.7:</strong></p>
<blockquote>
<ol class="arabic simple">
<li>In the functions searching for multiple matches every empty match adjacent
to the previous match is discarded.</li>
</ol>
</blockquote>
<p><strong>Incompatibilities between versions 2.6 and 2.5:</strong></p>
<blockquote>
<ol class="arabic simple">
<li>Removed function <tt class="docutils literal">plainfind</tt>.</li>
<li>Global variables (e.g. <em>rex_posix</em>, <em>rex_pcre</em>, etc.) are not created
by default. This can be changed at the stage of compilation by adding
<tt class="docutils literal"><span class="pre">-DREX_CREATEGLOBALVAR</span></tt> to <tt class="docutils literal">CFLAGS</tt>.</li>
</ol>
</blockquote>
<p><strong>Incompatibilities between versions 2.2 and 2.1:</strong></p>
<blockquote>
<ol class="arabic simple">
<li><a class="reference internal" href="#gsub">gsub</a>: a special &quot;break&quot; return of <em>repl</em> function is deprecated.</li>
<li>(PCRE) <a class="reference internal" href="#gsub">gsub</a>, <a class="reference internal" href="#gmatch">gmatch</a>: after finding an empty match at the current
position, the functions try to find a non-empty match anchored to the same
position.</li>
</ol>
</blockquote>
<p><strong>Incompatibilities between versions 2.1 and 2.0:</strong></p>
<blockquote>
<ol class="arabic simple">
<li><a class="reference internal" href="#match">match</a>, <a class="reference internal" href="#find">find</a>, <a class="reference internal" href="#tfind">tfind</a>, <a class="reference internal" href="#exec">exec</a>, <a class="reference internal" href="#dfa-exec-pcre">dfa_exec</a>: only one value (a <tt class="docutils literal">nil</tt>) is
returned when the subject does not match the pattern. Any other failure
generates an error.</li>
</ol>
</blockquote>
<p><strong>Incompatibilities between versions 2.0 and 1.19:</strong></p>
<blockquote>
<ol class="arabic simple">
<li>Lua 5.1 is required</li>
<li>Functions <tt class="docutils literal">newPCRE</tt> and <tt class="docutils literal">newPOSIX</tt> renamed to new</li>
<li>Functions <tt class="docutils literal">flagsPCRE</tt> and <tt class="docutils literal">flagsPOSIX</tt> renamed to <a class="reference internal" href="#flags">flags</a></li>
<li>Function <tt class="docutils literal">versionPCRE</tt> renamed to <a class="reference internal" href="#version">version</a></li>
<li>Method <tt class="docutils literal">match</tt> renamed to <a class="reference internal" href="#tfind">tfind</a></li>
<li>Method <tt class="docutils literal">gmatch</tt> removed (similar functionality is provided by function
<a class="reference internal" href="#gmatch">gmatch</a>)</li>
<li>Methods <a class="reference internal" href="#tfind">tfind</a> and <a class="reference internal" href="#exec">exec</a>: 2 values are returned on failure</li>
<li>(PCRE) <a class="reference internal" href="#exec">exec</a>: the returned table may additionally contain <em>named
subpatterns</em></li>
</ol>
</blockquote>
</div>
</div>
<div class="footer">
<hr class="footer" />
Generated on: 2017-11-06 16:45 UTC.

</div>
</body>
</html>