-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathEnDeREMap.js
1918 lines (1855 loc) · 87.7 KB
/
EnDeREMap.js
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
/* ========================================================================= //
// vi: set ts=4: //
// vim: set ts=4: //
#?
#? NAME
#? EnDeREMap.js - defintions of regular expression flavours
#?
#? SYNOPSIS
#? <SCRIPT language="JavaScript1.3" type="text/javascript" src="EnDeREMap.js"></SCRIPT>
#?
#? DESCRIPTION
#? Internal data structure for RegEx used in EnDeRE.parse().
#? It defines the EnDeTMP object used in EnDeRE.js.
#?
#? SEE ALSO
#? EnDeRE.js
#?
# HACKER's INFO
# Because we want to have this data structure in it's own file, it's not
# possible to use a sub object like EnDeRE.Map. Instead we use EnDeTMP.
# Sub objects in their own file would only be possible if the file would
# be included by that one defineing the EnDeRE object itself.
#
#? VERSION
#? @(#) EnDeREMap.js 3.8 12/04/11 23:46:06
#?
#? AUTHOR
#? 18-mar-08 Achim Hoffmann, mailto: EnDe (at) my (dash) stp (dot) net
#?
* ========================================================================= */
var EnDeREMap = new function() { this.SID = '3.8'; } // dummy definition for EnDe.SIDs
var EnDeTMP = new function() {
this.SID = '3.8';
// Xayide - Magierin von Horok
var x = -9, _x = '**EnDeRE: undefined or unknown/untested feature **';
var a = 1, _a = 'start grouping/identation';
var y = 2, _y = 'special escaping'; // see below
var i = 3, _i = 'supported within character class [..] only';
var d = 8, _d = 'behaviour depends on version';
var e = -1, _e = ' end grouping/identation';
var h = 4, _h = 'different behaviour';
var O = 0, _O = 'not available';
var r = 5, _r = 'unsure if supported';
var o = -8, _o = '---functionality known, but disabled---';
var K = 9, _K = 'available';
this.x = x; this._x = _x;
this.a = a; this._a = _a;
this.y = y; this._y = _y;
this.i = i; this._i = _i;
this.d = d; this._d = _d;
this.e = e; this._e = _e;
this.h = h; this._h = _h;
this.O = O; this._O = _O;
this.r = r; this._r = _r;
this.o = o; this._o = _o;
this.K = K; this._K = _K;
/* Above variables are used in the tables below, see this._chrs.prototype{}
* and this._literal.prototype{}.
* ************************************************************************
* ** Note that the variabl O is the capital letter o and not the **
* ** digit 0. The tables below must only contain the cpital letter O **
* ************************************************************************
*/
// ======================================================================= //
// public definition of all features and behaviours //
// ======================================================================= //
// == Step0 ==
/*
---- Description of the internal data structure used to parse RegEx ----
Most (all?) information about behaviours, features, dragons etc. will be
defined in tables. Then there is a small object used as global variable
while parsing the RegEx. Parsing is mainly driven by these tables.
For the tables 2 objects (hashes) are used:
_chrs{} - contains tables for different features
_desc{} - contains the descriptions of the features
_literal{} - contains tables for literal meta strings
_context{} - describes some special features
All these object have mainly the same hash keys. These keys are:
'ctrl' - table for control characters
'clss' - table of shortcuts for characters classes
'meta' - table of general meta characters
'escp' - table of characters becoming meta if escaped
'init' - table of characters which may enclose the RegEx
'raw' - array of string literals used to identify raw strings
'quantifier'- table of allowed quantifiers
'anchor' - table of characters allowed as anchors (word boundary)
'modifier' - table of characters used as for modifiers
'backreferences'- table of ..
All these tables are organized the same way: one header line -'fuchur'-
which describes the sequence of all other arrays in the hash and one key
for each supported language -for example ':POSIX:'- where it's value is
an array describing the availability of the feature.
The array consist of the values: x, a, y, i, d, e, h, O, r, o, K
where mainly O K are used if available or not available, and x if not
yet tested or unknown. In an ideal world, no x are used ;-)
These values are defined as global variables -better: constants- as they
may be needed in other functions too.
Note: the variable's name is the uppercase letter O, not the digit 0 but
it's value is 0 anyway.
Sometimes a meta character has different behaviour and meaning depending
on the language. These are cases, most meta characters have the same
meaning in all languages. The exceptions take effect in the description
_desc.ctrl{} and _desc.meta{} only.
For the exception a different key is used. The key is the meta character
(as for the standard case) appended by the language should be valid for.
Example: _desc.ctrl['d'] is for 'DEL character'
but also: _desc.meta['d'] is for 'digits'
while for Emacs it needs to be the first case, we define it like:
_desc.ctrl['d:Emacs'] is for 'DEL character'
The tables in _chrs{} and _desc{} can simply be accessed using the
character in the header line (fuchur), which comes from the parsed RegEx
string. The other object tables like in _literal{} and _context{} can
not be accessed using extracted string from the parsed RegEx, special
actions need to be done there.
EnDeRE.arr2hash() is used to convert an array to a hash for a specific
flavour. Then the parsed character is the hash key (as described above).
This is done for _chrs{} and _context{}.
_literal{} is build automatically from _desc{}, see Step1.
The global variable goab is used while parsing a RegEx. A new instance
will be initialized for each requested parse.
Following flavours are treated as equal:
expect and Tcl
ed and sed
*/
/* Values in the tables below have above values, y is special as follows:
*
* y Escaped character is not supported by the RegEx engine, but done
* by the string processing before, then feeds the converted string
* to the RegEx engine.
* This means that an escaped charater like \b has to be written as
* \\b to become a literal \b in the RegEx, conseqently funny is
* that \\\\ is required for a literal \ in the RegEx. Examples
* are python and Java.
* JavaScript is special: \b is literal \b for the RegEx if it is
* enclosed in /.../, but needs to be written as \\b if enclosed
* in "..." or '...' .
*** ToDo: above description obsolete with _chrs.raw[] 11-apr-08
*/
/*
* Grouping -classes, parantheses, brackets, braces- use value a and e
* which are 1 and -1 , this way we can simply "add" that value to the
* current goab variable which then counts the nested level too.
* All values should be grater than O so we can check: if (val > O) ..
* (exception to this is e but that's handled different anyway).
*/
// ToDo: Note: currently (march 2008) only O and K are supported in .parse()
// ToDo: anything else (except a and e) is treated as K
// ToDo: x is added additionally to the description
// some multiple used texts
var _xx = 'extended syntax (free spacing mode)';
var _ci = 'case insensitive';
var _gm = 'global matches';
var _da = 'dot matches all';
var _ml = 'multiline mode';
var _lo = 'use locale definition for \\w, \\W,\\b and \\B';
var _un = 'use Unicode definition for \\w, \\W,\\b and \\B';
var _mp = 'mainly UNIX man pages';
var _jf = "Mastering Regular Expressions, Jeffrey Friedl, O'Reilly";
var _vi = "Learning the vi, Linda Lamb & Arnold Robbins, O'Reilly";
this._goab = function() {};// container for all states while parsing
this._goab.prototype = {
hold : '', // contains not yet printed characters (mainly after a \ )
skip : 0, // count of characters to be skipped (mainly for meta string literals)
backr : 0, // count backreferences
isesc : false,// true if last character was escape character (\ usually)
isgroup : 0, // count group levels ()
isclass : false,// true if inside character class []
isrange : false,// true if inside quantifier {}
isspan : false,// true if inside RegEx literal
ismod : false,// true if in modifier state
escchr : '', // contains character used for escaping (\ usually)
start : '', // contains character after that RegEx starts (/ or " usually)
stop : '', // contains character before RegEx ends (/ or " usually)
quote : '', // contains character used as string delimiter
asis : true, // false: RegEx is evaluated as string first
// true: RegEx literal string (see quote above also)
regex : 0, // 0: before RegEx,
// 1: first character in RegEx,
// 2: after first character, inside RegEx,
// 3,4: behind RegEx (modifier)
// (awk, sed, perl, JavaScript etc. with / or " )
ic : 'i', // some matches are done case-insensitive
tab : '\t', // contains string used for identation
ident : '', // contains current identation string
orig : '', // set to the RegEx language/flavour passed in from GUI
lang : '', // set to the current RegEx language/flavour to parse
print : false,// true: description for meta character required
// false: just identaion on parantheses, brackets, braces
desc : null, // hash with all description texts
ctrl : null, // hash of control characters for current language
clss : null, // hash of characters classes for current language
meta : null, // hash of meta characters for current language
escp : null, // hash of escaped meta characters for current language
prop : null, // hash of Unicode properties support for current language
init : null, // hash of "starter" characters for current language
anchor : null, // hash of meta characters used as anchors
ctxctrl : null, // hash of control context for current language
ctxclss : null, // hash of class context for current language
ctxmeta : null, // hash of meta context for current language
ctxlook : null, // hash of lookaround grouping for current language
ctxmod : null, // hash of modifier context for current language
literal : null, // hash of supported classes and meta strings
modifier: null, // hash of modifiers for current language
quantifier:null // hash of quantifiers characters for current language
}; // _goab
this._lang = function() {};
this._lang.prototype = { // map all languages to the used RegEx engine
// goab.orig : goab.lang
//-----------+----------------
':Java-code': ':Java',
':Java-prop': ':Java',
':JavaScript': ':ECMA-262',
':VBScript' : ':.NET',
':VB.NET' : ':.NET',
':C#' : ':.NET',
':boo' : ':.NET',
':ModSecurity': ':PCRE',
':Erlang' : ':PCRE',
'_dump_' : ':Perl', // fake; not a language
// ':user-regex': ':user-regex',
'_dumm' : ''
}; // _lang
// ugly JavaScript does not allow 'char', 'class' and 'escape' as variable
// names, hence we have to use chrs, clss and escp :-((
this._chrs = function() {}; // list of meta characters for each language
this._chrs.prototype = {
'escchr': '\\',// other characters may be the escape character, like in MySQL
'escchr:MySQL' : "'",
'escchr:VB.NET' : '"',
'escchr:UltraEdit': '^',
ctrl: {
'desc' : 'list of supported control characters',
/* Note that "control characters" are considered on character, while
* "shortcut classes" (see below) ar a group of characters.
*/
/*
a BELL
b backspace
e ESC
h backspace
d DEL character
// ToDo: d disabled 'cause of conflict with digit class
f form feed
h
n newline
p \r\n // ToDo: a bit wrong here 'cause more than one character (see above)
p carriage return
t horizontal TAB
v vertical TAB
z EOF character (mainly Windows)
0 0-byte
// ToDo: for 0-byte see also chrs.escp[]
*/
'fuchur' : 'a b d e g h f n p r t v z 0',
//----------+ +---------------------------+,
':BRE' : [O,K,x,O,O,O,O,K,O,K,K,K,O,O],
':ERE' : [O,K,x,O,O,O,O,K,O,K,K,K,O,O],
':POSIX' : [O,K,x,O,O,O,O,K,O,K,K,K,O,O],
':awk' : [O,O,O,O,O,O,O,K,O,K,K,O,O,O],
':gawk' : [K,K,O,O,O,O,K,K,O,K,K,r,O,K], // \v probably starting with gawk 3.0
':bash' : [K,K,O,O,O,O,K,K,O,K,K,K,O,K],
':oldgrep' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':grep' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ggrep' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':egrep' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ed' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ex' : [O,O,O,O,O,O,x,x,O,x,x,O,O,O],
':sed' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':gsed' : [O,O,O,O,O,O,O,K,O,O,O,O,O,O],
':lex' : [O,K,O,O,O,O,K,K,O,K,K,O,O,K],
':flex' : [K,K,O,O,O,O,K,K,O,K,K,K,O,K],
':S-Lang' : [O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':Emacs' : [K,K,o,K,O,O,K,o,O,K,o,K,O,O], // t and n converted within string but unknown to RegEx engine
':Java' : [d,K,O,d,O,O,K,K,O,K,K,d,O,O], // \b within character class only
':.NET' : [K,K,O,K,O,O,K,K,O,K,K,K,O,K],
':Perl' : [K,K,x,K,O,O,K,K,O,K,K,r,O,K], // \v in 5.00x?, but not 5.8.x?
':PCRE' : [K,K,O,K,O,O,K,K,O,K,K,O,O,K],
':PHP' : [K,K,h,K,O,O,K,K,O,K,y,O,O,K],
':Python' : [y,y,x,O,O,O,y,y,O,y,y,r,O,y],
':Ruby' : [K,K,O,K,O,O,K,K,O,K,K,K,O,K],
':Tcl' : [K,K,x,K,O,O,K,K,O,K,K,K,O,K], // \B als Ersatz fuer \\
':C' : [K,K,x,K,O,O,K,K,O,K,K,K,O,K],
':VisualSt' : [K,K,O,K,K,K,K,K,O,K,K,K,O,K],
':ECMA-262' : [O,O,O,O,O,O,K,K,O,K,K,K,O,K],
':oldvi' : [O,K,O,O,O,O,x,K,O,K,K,O,O,O],
':vi' : [O,K,O,O,O,O,x,K,O,K,K,O,O,O],
':vim' : [O,K,O,K,O,O,O,K,O,K,K,O,O,O],
':nvi' : [O,K,O,O,O,O,x,K,O,K,K,O,O,O],
':elvis' : [O,K,O,O,O,O,x,K,O,K,K,O,O,O],
':UltraEdit': [O,K,O,O,O,O,O,K,K,K,K,O,O,O],
':UE32_Unix': [O,O,O,O,O,O,K,K,K,K,K,K,O,O],
':ISAPI_rew': [K,O,O,K,O,O,K,K,O,O,K,K,O,O],
':AS3' : [O,O,O,O,O,O,O,K,O,K,K,O,O,K],
// ToDo
/*
':AS2' : [x,x,x,x,x,O,x,x,O,x,x,x,x,x],
':CF' : [x,x,x,x,x,O,x,x,O,x,x,x,x,x],
':Lisp' : [x,x,x,x,x,O,x,x,O,x,x,x,x,x],
':XPath' : [x,x,x,x,x,O,x,x,O,x,x,x,x,x],
':XML' : [x,x,x,x,x,O,x,x,O,x,x,x,x,x],
ToDo: MySQL hat \' und \"
*/
':MySQL' : [O,y,O,K,O,O,K,K,O,K,K,K,K,h], // \0 not supported but 0 itself
':SQL' : [x,x,x,x,O,O,x,x,O,x,x,x,x,x]
}, // ctrl
clss: {
'desc' : 'list of supported shortcut classes',
// ToDo: enthaelt noch die Anchors (AbBGmMZ), diese hier entfernen ..
// ToDo: enthaelt noch die Modifier (lLuUQE), diese hier entfernen ..
/*
* NOTE that a, f, n, r, t and v are used as controls
* NOTE that b is used as control in rare cases
* NOTE that g, i, o and x are used as modifiers
m,M is word boundery (Tcl only)
y,Y is word boundery
v vertical tab (white space)
V not vertical tab (white space)
b when used as word boundery
e when used as end of upper|lower case
P when unicode properties are supported
*/
'fuchur' : 'A b B c C d D e E f F G h H i I k K l L m M N p P Q R s S u U v V w W X y Y z Z',
//----------+ +-------------------------------------------------------------------------------+,
':BRE' : [O,O,O,x,x,K,K,O,O,O,O,O,x,x,O,O,O,O,x,O,O,O,O,O,O,O,O,K,K,O,O,O,O,K,K,O,O,O,O,O],
':ERE' : [O,O,O,x,x,K,K,O,O,O,O,O,x,x,O,O,O,O,x,O,O,O,O,O,O,O,O,K,K,O,O,O,x,K,K,O,O,O,O,O],
':POSIX' : [O,K,K,x,x,K,K,O,O,O,O,O,x,x,O,O,O,O,x,O,O,O,O,O,O,O,O,K,K,O,O,O,x,K,K,O,O,O,O,O],
':awk' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O], // w,W description wrong in Friedl's 1'st edition
':gawk' : [O,O,K,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,K,O,K,O,O,O], // : within class only
':bash' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':oldgrep' : [O,O,O,x,x,O,O,O,O,O,O,O,x,x,O,O,O,O,x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':grep' : [O,O,O,x,x,O,O,O,O,O,O,O,x,x,O,O,O,O,x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ggrep' : [O,K,K,x,x,O,O,O,O,O,O,O,x,x,O,O,O,O,x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,O],
':egrep' : [O,K,K,x,x,O,O,O,O,O,O,O,x,x,O,O,O,O,x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,O],
':ed' : [O,K,K,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,O],
':ex' : [O,x,x,O,O,O,O,K,K,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,O,O,O,O,O,K,K,O,O,K,K,O,O,O,O,O],
':sed' : [O,O,O,x,x,O,O,O,O,O,O,O,x,x,O,O,O,O,x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':gsed' : [O,K,K,x,x,O,O,O,O,O,O,O,x,x,O,O,O,O,x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,O],
':lex' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':flex' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':S-Lang' : [O,O,O,h,h,K,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':Emacs' : [O,K,K,o,x,O,O,O,O,O,O,O,x,x,O,O,O,O,x,O,O,O,O,O,O,O,O,r,r,O,O,O,x,K,K,O,O,O,O,O], // s,S is special, somehow; \c is not used but ?\ instead
':Java' : [K,K,K,K,x,K,K,O,K,O,O,K,x,x,O,O,O,O,x,x,x,x,x,K,K,K,x,K,K,x,x,O,O,K,K,O,O,O,K,K],
':.NET' : [K,K,K,K,x,K,K,O,O,O,O,K,x,x,O,O,O,O,x,x,x,x,x,K,K,x,x,K,K,O,O,O,O,K,K,O,O,O,K,K],
':Perl' : [K,K,K,x,K,K,K,O,K,O,O,K,x,x,O,O,O,d,d,d,O,O,x,d,d,K,x,d,d,K,K,O,x,d,d,K,O,O,K,K], // p,P depends on version, Note that variables are interpolated inside \Q...\E, hence $ and @ are no literals there; \s does not match vertical tab (\v); \K starting with 5.10
':PCRE' : [K,K,K,K,K,K,K,O,K,O,O,K,K,K,O,O,O,K,O,O,O,O,O,K,K,K,K,K,K,O,O,K,K,K,K,K,O,O,K,K], // p,P,X needs special compiler flags, but are supported i.g.; \g{} for relative backreference (see .esc{} below)
':PHP' : [K,K,K,K,K,K,K,O,K,O,O,K,K,K,O,O,O,x,x,x,O,O,x,K,K,K,K,K,K,O,x,K,K,K,K,K,O,O,K,K], // R is recursion of backreferences
':Python' : [O,K,K,x,x,K,K,O,O,O,O,O,x,x,O,O,O,O,x,O,O,O,O,O,O,O,O,K,K,O,O,O,x,d,d,O,O,O,O,h], // w,W description different in Friedl's 1'st and 3'rd edition
':Ruby' : [h,K,K,K,K,K,K,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,O,O,O,O,O,K,K,O,O,O,O,K,K,O,O,O,h,h], // b innerhalb [] ist backspace
':Tcl' : [K,O,h,K,O,K,K,O,O,O,O,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,O,K,K,O,O,O,O,K,K,O,K,K,K,K], // up to Tcl 8.x; B is special escaping in Tcl, not word boundary
':C' : [x,x,x,x,x,x,x,O,x,O,O,x,x,x,O,O,O,O,x,x,x,x,x,x,x,x,x,x,x,x,x,O,x,x,x,x,x,x,x,x],
':VisualSt' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ECMA-262' : [O,K,K,O,O,K,K,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,K,K,O,O,O,O,O], // \b innerhalb [] ist backspace
':oldvi' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,O,O,O,O,O],
':vi' : [O,O,O,O,O,O,O,K,K,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,O,O,O,O,O],
':vim' : [O,O,O,O,O,O,O,K,K,K,K,O,O,O,K,K,K,K,K,K,O,O,O,K,K,O,O,K,K,K,K,O,O,O,O,O,O,O,O,O],
':nvi' : [O,O,O,O,O,O,O,K,K,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,O,O,O,O,O],
':elvis' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':UltraEdit': [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':UE32_Unix': [O,O,O,O,O,K,K,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,K,K,O,O,O,O,O],
':ISAPI_rew': [O,K,K,K,K,K,K,O,K,O,O,O,O,O,O,O,O,O,K,K,O,O,O,O,O,K,O,K,K,K,K,O,O,K,K,K,O,O,O,O],
':AS3' : [O,O,O,x,x,K,K,O,O,O,O,O,O,O,O,O,O,O,x,O,O,O,O,O,O,O,O,K,K,O,O,O,O,K,K,O,O,O,O,O],
':MySQL' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':SQL' : [x,x,x,x,x,x,x,O,x,O,O,x,x,x,O,O,O,O,x,x,x,x,x,x,x,x,x,x,x,x,x,O,x,x,x,x,x,x,x,x]
/*
s,S,w,W is supported within character classes [...] only up to perl 5.x
hence these entries are marked d instead of i
*/
// ToDo: need table with ctrl-chars and class chars marking if allowed within character class
// ToDo: behaviour of ^ . - ] \ within [...]
// ToDo: POSIX character equivalents, collating sequences
}, // clss
meta: {
'desc' : 'list of supported meta characters',
// description for each column is same as in desc.meta
/*
/ when used as meta character (other than RegEx delimiter)
\ when used as backreference
& when used as backreference
~ when used as backreference (vi)
# when used as comment to end of line
. when used as "match any character"
_ when used as "match any character"
? when used as "match one or none character"
* when used as "match any number of characters"
% when used as "match any number of characters"
- when used as character range in class
: --
, --
; --
= --
*/
// ToDo: single quote missing
'fuchur' : '( ) [ ] { } < > ^ $ ! " ` % & /\\ | ? = * + ~ # , ; . : - _ @',
//----------+ +-------------------------------------------------------------+,
':BRE' : [a,e,a,e,a,e,O,O,K,K,x,O,x,O,O,O,K,O,O,O,K,O,O,O,O,O,K,O,K,O,O],
':ERE' : [a,e,a,e,a,e,O,O,K,K,x,O,x,O,O,O,K,K,K,O,K,K,O,O,O,O,K,O,K,O,O],
':POSIX' : [a,e,a,e,a,e,O,O,K,K,x,O,x,O,O,O,K,K,K,O,K,K,O,O,O,O,K,O,K,O,O],
':awk' : [a,e,a,e,O,O,O,O,K,K,O,O,O,O,O,O,K,K,K,O,K,K,O,O,O,O,K,O,K,O,O],
':gawk' : [a,e,a,e,a,e,K,K,K,K,O,O,K,O,O,O,K,K,K,O,K,K,O,O,O,O,K,O,K,O,O], // gawk also has '
':bash' : [h,h,a,e,h,h,h,h,K,K,K,K,K,O,K,O,K,K,h,O,K,O,h,h,O,h,h,O,K,O,O], // ? is any single character
':oldgrep' : [O,O,O,O,O,O,O,O,K,K,O,O,O,O,O,O,K,O,O,O,K,O,O,O,O,O,K,O,O,O,O],
':grep' : [a,e,a,e,a,e,O,O,K,K,O,O,O,O,O,O,K,d,O,O,K,O,O,O,O,O,K,O,K,O,O],
':ggrep' : [a,e,a,e,a,e,O,O,K,K,O,O,O,O,O,O,K,K,O,O,K,K,O,O,O,O,K,O,K,O,O],
':egrep' : [a,e,a,e,a,e,K,K,K,K,O,O,O,O,O,O,O,K,K,O,K,K,x,O,O,O,K,x,K,O,O],
':ed' : [a,e,a,e,a,e,K,K,K,K,O,O,K,O,O,O,K,O,K,O,K,O,O,O,O,O,K,O,K,O,O], // ' and ` fuer end of line
':ex' : [a,e,a,e,a,e,K,K,K,K,O,O,O,O,K,O,K,O,O,O,K,O,K,O,O,O,K,O,K,O,O],
':sed' : [a,e,a,e,O,O,O,O,K,K,O,O,O,O,y,O,K,K,K,O,K,O,O,O,O,O,K,O,K,O,O],
':gsed' : [a,e,a,e,a,e,K,K,K,K,x,O,x,O,y,O,K,i,K,O,K,O,O,O,O,O,K,O,K,O,O],
':lex' : [a,e,a,e,a,e,O,O,K,K,O,O,O,O,O,h,O,K,K,O,K,K,O,O,O,O,K,O,K,O,O],
':flex' : [a,e,a,e,a,e,O,O,K,K,O,O,O,O,O,h,O,K,K,O,K,K,O,O,O,O,K,O,K,O,O],
':S-Lang' : [a,e,a,e,O,O,K,K,K,K,O,O,O,O,O,O,K,O,K,O,K,K,O,O,O,O,K,O,O,O,O],
':Emacs' : [a,e,a,e,x,x,K,K,K,K,x,x,x,O,x,O,x,K,K,x,K,K,x,x,x,x,K,x,K,O,O],
':Java' : [a,e,a,e,a,e,O,O,K,K,x,O,x,O,x,O,x,K,K,x,K,K,x,x,x,x,K,x,K,O,O],
':.NET' : [a,e,a,e,a,e,O,O,K,K,x,O,x,O,x,O,x,K,K,x,K,K,x,x,x,x,K,x,K,O,O],
':Perl' : [a,e,a,e,a,e,O,O,K,K,x,O,x,O,K,O,K,K,K,x,K,K,x,h,x,x,K,x,K,O,O], // # with /x modifier only
':PCRE' : [a,e,a,e,a,e,O,O,K,K,x,O,x,O,x,O,x,K,K,x,K,K,x,x,x,x,K,x,K,O,O],
':PHP' : [a,e,a,e,a,e,O,O,K,K,x,O,x,O,x,O,x,K,K,x,K,K,x,x,x,x,K,x,K,O,O],
':Python' : [a,e,a,e,a,e,K,K,K,K,x,O,x,O,x,O,x,K,K,x,K,K,x,x,x,x,K,x,K,O,O],
':Ruby' : [a,e,a,e,a,e,O,O,K,K,O,O,O,O,O,O,K,K,K,O,K,K,O,O,O,O,K,O,K,O,O],
':Tcl' : [a,e,a,e,a,e,O,O,K,K,O,O,O,O,h,O,K,K,K,O,K,K,O,O,O,O,K,O,K,O,O], // ([bc])\1 matches bb or cc but not bc
':C' : [x,x,x,x,x,x,x,x,x,x,x,O,x,O,x,O,x,x,x,x,x,x,x,x,x,x,x,x,x,O,O],
':VisualSt' : [a,e,a,e,a,e,K,K,K,K,O,O,O,O,O,O,K,K,O,O,K,K,h,h,O,O,K,h,K,O,h], // : for Unicode properties; NOTE: must be h, see parse()
':ECMA-262' : [a,e,a,e,a,e,O,O,K,K,K,O,O,O,O,O,K,K,K,K,K,K,O,O,O,O,K,K,K,O,O], // what does = ??
':oldvi' : [O,O,O,O,O,O,O,O,K,K,O,O,O,O,K,O,K,K,K,O,K,K,K,O,O,O,K,O,O,O,O],
':vi' : [a,e,a,e,a,e,K,K,K,K,O,O,O,O,K,O,K,K,K,O,K,K,K,O,O,O,K,O,K,O,O],
':vim' : [a,e,a,e,a,e,K,K,K,K,O,O,O,O,K,O,K,K,K,O,K,K,K,O,O,O,K,O,K,O,O],
':nvi' : [a,e,a,e,a,e,K,K,K,K,O,O,O,O,K,O,K,K,K,O,K,K,K,O,O,O,K,O,K,O,O],
':elvis' : [O,O,a,e,a,e,O,O,K,K,O,O,O,O,K,O,O,O,K,d,K,K,O,O,O,O,K,K,K,O,K], // what does = ??
':UltraEdit': [O,O,a,e,a,e,O,O,O,K,O,O,O,K,O,O,O,O,K,O,K,K,K,O,O,O,O,O,K,O,O], // ( and ) are valid in replacement part only
':UE32_Unix': [a,e,a,e,a,e,O,O,K,K,O,O,O,O,O,O,K,K,O,O,K,K,O,O,O,O,K,O,K,O,O],
':ISAPI_rew': [a,e,a,e,a,e,K,K,K,K,0,O,0,O,O,O,K,K,K,O,K,K,O,O,O,O,K,O,K,O,O],
':AS3' : [a,e,a,e,a,e,O,O,K,K,O,O,O,O,O,O,K,K,K,O,K,K,O,O,O,O,K,O,K,O,O],
':MySQL' : [a,e,a,e,a,e,x,x,K,K,d,x,x,K,x,x,K,K,K,O,K,K,x,x,x,x,K,x,x,K,O], // any character can be used as escape character
// SQL-99 ':SQL3' : [x,x,a,e,x,x,x,x,K,K,x,x,x,K,x,x,K,x,x,x,K,K,x,x,x,x,x,x,K,K,O],
':SQL' : [x,x,a,e,x,x,x,x,K,x,x,x,x,K,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,K,O]
/* ToDo:
allow empty alternate right to |
POSIX, lex, awk, gawk: no
*/
}, // meta
escp: {
'desc' : 'list of characters becoming meta character if escaped',
// ToDo: 0-byte; oddities with \0078 (2 bytes?)
// ToDo: \9 is \011 in Tcl and awk but not in gawk
// ToDo: \10, \11, ... in perl but only if as much matches, otherwise octal value
'(' : 'start grouping',
')' : 'end grouping',
'[' : '** ? **',
']' : '** ? **',
'{' : 'start quantifier range',
'}' : 'end quantifier range',
'<' : 'start word boundery',
'>' : 'end word boundery',
'|' : 'alternate in grouping',
'?' : 'one allowed, but it is optional',
'*' : 'any number, all are optional',
'+' : 'at least one, more are optional',
// ^ all above should be the same as in _desc.meta
'O' : 'short octal \\O (value 9 if only \\O, others are backreferences)',
'o' : 'long octal \\OOO', //-------------------------------------, |
'0' : 'octal value with mandatory \\0 prefix (0 = digit)',//----, | |
'U' : 'unicode \\uHHHHHHH',//---------------------------------, | | |
'u' : 'unicode \\uHHHH', //-------------------------------, | | | |
'v' : 'variable length hex \\x{HHH}', //------------------, | | | | |
'X' : 'short hex \\xH', //---------------------------, | | | | | |
'x' : 'long hex \\xHH', //-------------------------, | | | | | | |
'z' : '** unused ** ', //-----------------------, | | | | | | | |
'C' : 'exactly one byte \\C', //-----------------, | | | | | | | | |
'c' : 'character \\c', //-------------------, | | | | | | | | | |
'g' : 'when used as backreference', //--------, | | | | | | | | | | |
'"' : '^** ? **', //---------------, | | | | | | | | | | | |
'~' : 'when used as backreference', //----, | | | | | | | | | | | | |
'&' : 'when used as backreference', //--, | | | | | | | | | | | | | |
'=' : 'cursor position', //-----\ | | | | | | | | | | | | | | |
// | | | | | | | | | | | | | | | |
'fuchur' : '( ) [ ] { } < > | ? = * + & ~ " g c C z x X v u U 0 o O',
//----------+ +-------------------------------------------------------+,
':BRE' : [K,K,O,O,K,K,O,O,O,O,O,O,O,O,O,O,O,x,x,O,O,O,O,x,x,x,O,O],
':ERE' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,x,x,O,O,O,O,x,x,x,O,O],
':POSIX' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,x,x,O,O,O,O,x,x,x,O,O],
':awk' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,x,O,O,K,O,O,O,O,O,K,O],
':gawk' : [O,O,O,O,O,O,K,K,O,O,O,O,O,O,O,O,O,K,O,O,K,O,O,O,O,d,K,K], // also hex 0xHH, octal is 0oo
':bash' : [h,h,a,e,h,h,h,h,K,h,O,K,O,O,O,O,O,x,K,O,h,O,O,O,O,x,h,O], // octal is 0ooo not \o, hex is 0xhh
':oldgrep' : [K,K,O,O,K,K,O,O,x,x,O,O,x,O,O,O,O,x,x,O,O,O,O,O,O,x,O,O],
':grep' : [K,K,O,O,K,K,O,O,K,K,O,O,K,O,O,O,O,x,x,O,O,O,O,O,O,x,O,O],
':ggrep' : [K,K,O,O,K,K,O,O,K,K,O,O,K,O,O,O,O,x,x,O,O,O,O,O,O,x,O,O],
':egrep' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,x,O,O],
':ed' : [K,K,O,O,K,K,K,K,O,K,O,O,K,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ex' : [K,K,O,O,K,K,K,K,O,O,O,O,K,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':sed' : [K,K,O,O,O,O,O,O,x,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,x,O,O],
':gsed' : [K,K,O,O,K,K,O,O,K,O,O,O,O,O,O,O,O,x,x,O,O,O,O,O,O,x,O,O],
':lex' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,x,K,K],
':flex' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,K,O,O,O,x,K,K],
':S-Lang' : [K,K,O,O,O,O,K,K,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':Emacs' : [K,K,O,O,O,O,K,K,K,O,O,O,O,O,O,O,O,x,x,O,y,O,x,O,O,x,y,O],
':Java' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,x,O,K,h,x,K,O,K,K,h],
':.NET' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,x,O,K,O,x,K,O,x,K,h],
':Perl' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,K,K,O,K,K,K,O,O,x,K,h], // \g11 works, but not \g{11}
':PCRE' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,K,K,O,K,K,x,O,O,x,K,h], // \ooo is used for octal values too, grrr :-(
':PHP' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,K,O,K,K,x,O,O,O,O,O],
':Python' : [O,O,O,O,O,O,O,O,K,O,O,O,O,O,O,O,O,x,x,O,y,O,x,O,O,x,y,h],
':Ruby' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,O,O,K,K,x,O,O,x,K,K],
':Tcl' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,O,O,K,K,x,K,K,O,K,K], // c beachtet nur die 5 letzten Bits
':C' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,x,x,O,K,x,x,O,O,x,K,x],
':VisualSt' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,O,x,K,O,O,O,O],
':ECMA-262' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,O,O,K,O,x,K,O,x,O,O],
':oldvi' : [O,O,O,O,O,O,O,O,O,O,O,O,K,O,O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':vi' : [K,K,O,O,K,K,K,K,O,K,O,O,d,K,K,O,O,O,O,O,O,O,O,O,O,O,O,O],
':vim' : [K,K,O,O,K,K,K,K,K,K,O,O,d,K,K,O,O,O,O,O,O,O,O,O,O,O,O,O],
':nvi' : [K,K,O,O,K,K,K,K,O,K,O,O,K,K,K,O,O,O,O,O,O,O,O,O,O,O,O,O],
':elvis' : [O,O,O,O,K,K,x,x,O,K,K,O,K,K,K,O,O,O,O,O,O,O,O,O,O,O,O,O],
':UltraEdit': [K,K,O,O,K,K,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,x,O,O,O,O,O],
':UE32_Unix': [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,x,O,O,O,O,O],
':ISAPI_rew': [O,O,O,O,O,O,K,K,O,O,O,O,O,O,O,O,O,K,K,O,K,K,K,O,O,K,K,K], // octal is \[0-7]{1,3}
':AS3' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,K,O,x,O,O,O,O,O],
':MySQL' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,x,O,O,x,O,O],
':SQL' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,x,x,O,O,O,x,O,O,x,O,O]
}, // escp
prop: {
'desc' : 'supported Unicode properties',
/* this tables is used for all languages/flavours which are supported
* in _chrs.class[]['P']
*/
'1' : 'supports shorthand Unicode properties like \\pL',
'2' : 'supports longhand Unicode properties like \\p{Lu}',
'{' : 'supports standard Unicode properties',
'L' : 'supports full (long names) Unicode properties',
'-' : 'supports - as word delimiter in full Unicode properties',
'_' : 'supports _ as word delimiter in full Unicode properties',
'.' : 'supports space as word delimiter in full Unicode properties',
':' : 'supports charset class Unicode properties like [:Lu]',
'&' : 'supports composite property like \\p{L&}',
'P' : 'supports negated Unicode properties like \\P{L}',
'^' : 'supports negated Unicode properties like \\p{^L}',
's' : 'supports Unicode script properties',
'b' : 'supports Unicode block properties',
/* NOTE that script and block properties are long names,
* this may also be possible if long names itself are not
* supported (like in .NET)
*/
'N' : 'supports Unicode In prefix like \\p{InGreek}',
'S' : 'supports Unicode Is prefix like \\p{IsLatin}',
'+' : 'supports \\p{all}',
'*' : 'supports \\p{Any}',
'=' : 'supports \\p{Assigned}',
'!' : 'supports \\p{Unassigned}',
//
'fuchur' : '1 2 { L - _ . : & P ^ s b N S + * = !',
//----------+ +-------------------------------------+,
':BRE' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ERE' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':POSIX' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':awk' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':gawk' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':bash' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':oldgrep' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':grep' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ggrep' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':egrep' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ed' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ex' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':sed' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':gsed' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':lex' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':flex' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':S-Lang' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':Emacs' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':Java' : [K,K,K,O,O,O,O,x,O,O,O,O,K,K,O,K,O,O,O],
':.NET' : [O,K,K,O,O,O,O,x,O,O,O,O,K,O,K,O,O,O,O],
':Perl' : [K,K,K,K,K,K,K,x,K,K,K,K,K,K,O,K,K,K,K],
':PCRE' : [K,K,K,O,O,O,O,x,K,K,K,K,K,K,K,O,K,x,x],
':PHP' : [K,K,K,O,O,O,O,x,K,K,K,K,K,K,K,O,K,x,x],
':Python' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':Ruby' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':Tcl' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':C' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':VisualSt' : [O,K,O,O,O,O,O,K,O,O,O,O,O,O,O,O,O,O,O],
':ECMA-262' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':oldvi' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':vi' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':vim' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':nvi' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':elvis' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':UltraEdit': [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':UE32_Unix': [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ISAPI_rew': [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':AS3' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':MySQL' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':SQL' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O]
}, // prop
quantifier: {
'desc' : 'list of supported quantifiers, ranges, intervals',
// NOTE that * + and ? column below must the same as in table chrs[] above
// NOTE we use d instead of n and m in {n,m} so it can be used as \d later
// /- greedy-\ /------- intervals -------\ /--- lazy ---\ /- possessive-\
'fuchur' : ['*','+','?','{d}','{,d}','{d,}','{d,d}','*?','+?','??','*+','++','?+'],
//----------+ +---------------------------------------------------------------------+,
':BRE' : [ K, O, O, K, O, K, K, K, K, K, O, O, O ],
':ERE' : [ K, K, K, K, O, K, K, K, K, K, O, O, O ],
':POSIX' : [ K, K, K, K, O, K, K, K, K, K, O, O, O ],
':awk' : [ K, O, K, O, O, O, O, O, O, O, O, O, O ],
':gawk' : [ K, K, K, K, O, K, K, O, O, O, O, O, O ],
':bash' : [ K, O, h, O, O, O, O, O, O, O, O, O, O ],
':oldgrep' : [ K, O, O, K, O, K, K, O, O, O, O, O, O ],
':grep' : [ K, O, O, K, O, K, K, O, O, O, O, O, O ],
':ggrep' : [ K, K, O, K, O, K, K, x, x, x, x, x, x ],
':egrep' : [ K, K, K, K, O, K, K, O, O, O, O, O, O ],
':ed' : [ K, K, K, K, O, K, K, O, O, O, O, O, O ],
':ex' : [ K, K, K, K, O, K, K, O, O, O, O, O, O ],
':sed' : [ K, O, K, K, O, K, K, O, O, O, O, O, O ],
':gsed' : [ K, O, K, K, O, K, K, O, O, O, O, O, O ],
':lex' : [ K, K, K, K, O, O, K, O, O, O, O, O, O ],
':flex' : [ K, K, K, K, O, O, K, O, O, O, O, O, O ],
':S-Lang' : [ K, K, K, O, O, O, O, O, O, O, O, O, O ],
':Emacs' : [ K, K, K, K, O, K, K, x, x, x, x, x, x ],
':Java' : [ K, K, K, K, O, K, K, K, K, K, K, K, K ],
':.NET' : [ K, K, K, K, O, K, K, K, K, K, O, O, O ],
':Perl' : [ K, K, K, K, O, K, K, K, K, K, K, K, K ],
':PCRE' : [ K, K, K, K, O, K, K, K, K, K, K, K, K ],
':PHP' : [ K, K, K, K, O, K, K, K, K, K, K, K, K ],
':Python' : [ K, K, K, K, O, K, K, x, x, x, x, x, x ],
':Ruby' : [ K, K, K, K, O, K, K, K, K, O, O, O, O ],
':Tcl' : [ K, K, K, K, O, K, K, K, K, K, O, O, O ],
':C' : [ x, x, x, K, O, K, K, O, O, O, O, O, O ],
':VisualSt' : [ K, K, O, O, O, O, O, O, O, O, O, O, O ],
':ECMA-262' : [ K, K, K, K, O, K, K, K, K, K, O, O, O ],
':oldvi' : [ K, K, K, O, O, O, O, O, O, O, O, O, O ],
':vi' : [ K, K, K, K, O, K, K, O, O, O, O, O, O ],
':vim' : [ K, K, K, K, K, K, K, O, O, O, O, O, O ], // kann auch \{-n} \{-n,} \{-n,m} \{-,m}
':nvi' : [ K, K, K, K, O, K, K, O, O, O, O, O, O ],
':elvis' : [ K, K, K, K, O, K, K, O, O, O, O, O, O ],
':UltraEdit': [ K, K, K, O, O, O, O, O, O, O, O, K, O ],
':UE32_Unix': [ K, K, O, O, O, O, O, O, O, O, O, O, O ],
':ISAPI_rew': [ K, K, K, K, O, K, K, K, x, x, O, O, O ],
':MySQL' : [ K, K, K, K, O, K, K, O, O, O, O, O, O ],
':AS3' : [ K, K, K, K, O, O, K, K, K, O, O, O, O ],
':SQL' : [ x, x, x, K, O, K, K, x, x, x, x, x, x ]
}, // quantifier
modifier: {
'desc' : 'list of supported modifiers',
'fuchur' : 'A b c D d e i g m n o p q s S t u U w x X',
//----------+ +-----------------------------------------+,
':BRE' : [O,O,x,O,x,x,x,x,x,O,O,O,O,x,O,O,O,O,O,O,O],
':ERE' : [O,O,x,O,x,x,x,x,x,O,O,O,O,x,O,O,O,O,O,O,O],
':POSIX' : [O,O,x,O,x,x,K,K,K,O,O,O,O,x,O,O,O,O,O,O,O],
':awk' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':gawk' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':bash' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':oldgrep' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':grep' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ggrep' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':egrep' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ed' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ex' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':sed' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':gsed' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':lex' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':flex' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':S-Lang' : [O,O,K,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':Emacs' : [O,O,x,O,O,x,x,x,x,O,O,O,O,x,O,O,O,O,O,O,O],
':Java' : [O,O,O,O,K,O,K,O,K,O,O,O,O,K,O,O,K,O,O,K,O],
':.NET' : [O,O,O,O,O,O,K,O,K,K,O,O,O,K,O,O,O,O,O,K,O],
':Perl' : [O,O,K,O,O,K,K,K,K,O,K,O,O,K,O,O,O,O,O,K,O],
':PCRE' : [O,O,O,O,O,O,K,O,K,O,O,O,O,K,O,O,O,O,O,K,O],
':PHP' : [K,O,O,K,O,K,K,O,K,O,O,O,O,K,K,O,O,K,O,K,K],
':Python' : [O,O,x,O,O,x,x,x,x,O,O,O,O,x,O,O,O,O,O,O,O],
':Ruby' : [O,O,O,O,O,O,K,O,h,O,K,O,O,O,O,O,O,O,O,K,O], // m behaves as s in perl
':Tcl' : [O,K,K,O,O,K,K,O,K,K,O,K,K,K,O,K,O,O,K,K,O],
':C' : [O,O,x,O,O,x,x,x,x,O,O,O,O,x,O,O,O,O,O,O,O],
':VisualSt' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ECMA-262' : [O,O,O,O,O,O,K,K,K,O,O,O,O,O,O,O,O,O,O,O,O],
':oldvi' : [O,O,O,O,O,O,O,K,O,O,O,O,O,O,O,O,O,O,O,O,O],
':vi' : [O,O,O,O,O,O,O,K,O,O,O,O,O,O,O,O,O,O,O,O,O],
':vim' : [O,O,O,O,O,O,O,K,O,O,O,O,O,O,O,O,O,O,O,O,O],
':nvi' : [O,O,O,O,O,O,O,K,O,O,O,O,O,O,O,O,O,O,O,O,O],
':elvis' : [O,O,O,O,O,O,O,K,O,O,O,O,O,O,O,O,O,O,O,O,O],
':UltraEdit': [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':UE32_Unix': [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ISAPI_rew': [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':AS3' : [O,O,x,O,O,O,O,K,K,O,O,O,O,K,O,O,O,O,O,K,O],
':MySQL' : [O,O,x,O,O,x,x,x,x,O,O,O,O,x,O,O,O,O,O,O,O],
':SQL' : [O,O,x,O,O,x,x,x,x,O,O,O,O,x,O,O,O,O,O,O,O]
// all above as greedy, lazy and possessive
}, // modifier
anchor: {
'desc' : 'list of supported anchor meta characters',
'fuchur' : '^ % A b B G m M y Y z Z < > $',
//----------+ +-----------------------------+,
':bash' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ed' : [K,O,O,K,K,O,O,O,O,O,O,O,K,K,K],
':ex' : [K,O,O,x,x,O,O,O,O,O,O,O,K,K,K],
':lex' : [K,O,O,O,O,O,O,O,O,O,O,O,O,O,K],
':flex' : [K,O,O,O,O,O,O,O,O,O,O,O,O,O,K],
':S-Lang' : [K,O,O,O,O,O,O,O,O,O,O,O,K,K,K],
':Java' : [K,O,K,K,K,K,O,O,O,O,K,K,O,O,K],
':.NET' : [K,O,K,K,K,K,O,O,O,O,K,K,O,O,K],
':Perl' : [K,O,K,K,K,K,O,O,O,O,K,K,O,O,K],
':PCRE' : [K,O,K,K,K,K,O,O,O,O,K,K,O,O,K],
':PHP' : [K,O,K,K,K,K,O,O,O,O,K,K,O,O,K],
':Ruby' : [K,O,K,O,O,O,O,O,O,O,K,K,O,O,K], // ^ and $ match newline!
':Tcl' : [K,O,K,O,O,O,K,K,K,K,O,O,O,O,K],
':VisualSt' : [K,O,O,O,O,O,O,O,O,O,O,O,K,K,K],
':ECMA-262' : [K,O,K,K,K,O,O,O,O,O,K,O,O,O,K], // \b innerhalb [] ist backspace
':oldvi' : [K,O,O,O,O,O,O,O,O,O,O,O,x,x,K],
':vi' : [K,O,O,O,O,O,O,O,O,O,O,O,K,K,K],
':vim' : [K,O,O,O,O,O,O,O,O,O,O,O,K,K,K],
':nvi' : [K,O,O,O,O,O,O,O,O,O,O,O,K,K,K],
':elvis' : [K,O,O,O,O,O,O,O,O,O,O,O,O,O,K],
':UltraEdit': [O,K,O,O,O,O,O,O,O,O,O,O,O,O,K],
':UE32_Unix': [K,O,O,O,O,O,O,O,O,O,O,O,O,O,K],
':ISAPI_rew': [K,O,O,K,K,O,O,O,O,O,O,O,K,K,K],
':AS3' : [K,O,O,K,K,O,O,O,O,O,O,O,O,O,K],
':MySQL' : [x,O,x,x,x,x,O,O,O,O,x,x,x,x,x],
':SQL' : [x,O,x,x,x,x,O,O,O,O,x,x,x,x,x]
},
init: {
/*
_ if string for RegEx does not require enclosing characters
" means that the RegEx is evaluated as a string first, some
characters need to be escaped (special handling in parse())
@ when raw string is supported (@ in C#, r in python, ' in PHP)
/ usual regular expression delimiter, literal string follows
NOTE
if there are no delimiters (any starting at /) and no string
interpretation (" and/or @ not set), then it's a raw (literal)
RegEx (like in lex or flex)
*/
'desc' : 'list of characters enclosing the RegEx',
// special purpose-\ /-some possible delimiters
'fuchur' : '_ " @ / ( [ { < ! # ; , | :',
//----------+ +---------------------------+,
':BRE' : [O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':ERE' : [O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':POSIX' : [O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':awk' : [O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':gawk' : [O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':bash' : [O,O,O,K,O,O,K,O,O,O,O,O,O,O],
':oldgrep' : [K,O,O,O,O,O,O,O,O,O,O,O,O,O], // usually inside ' (for shell)
':grep' : [K,O,O,O,O,O,O,O,O,O,O,O,O,O], // usually inside ' (for shell)
':ggrep' : [K,O,O,O,O,O,O,O,O,O,O,O,O,O], // usually inside ' (for shell)
':egrep' : [K,O,O,O,O,O,O,O,O,O,O,O,O,O], // usually inside ' (for shell)
':ed' : [O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':ex' : [O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':sed' : [O,O,O,K,O,O,O,O,K,K,K,K,K,K], // sed can use (nearly) any character
':gsed' : [O,O,O,K,O,O,O,O,K,K,K,K,K,K],
':lex' : [K,O,O,O,O,O,O,O,O,O,O,O,O,O],
':flex' : [K,O,O,O,O,O,O,O,O,O,O,O,O,O],
':S-Lang' : [O,K,O,O,O,O,O,O,O,O,O,O,O,O],
':Emacs' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O],
':Erlang' : [O,K,O,O,O,O,O,O,O,O,O,O,O,O],
':Java' : [O,K,K,O,O,O,O,O,O,O,O,O,O,O],
':.NET' : [O,K,K,O,O,O,O,O,O,O,O,O,O,O],
':Perl' : [O,K,K,K,K,K,K,K,K,K,K,K,K,K], // perl can use any character; ' also
':PCRE' : [O,K,K,K,K,x,K,x,O,O,O,O,O,O],
':PHP' : [O,K,K,K,K,K,K,K,K,K,K,K,K,K], // PHP can use any character
':Python' : [O,K,K,O,O,O,O,O,O,O,O,O,O,O],
':Ruby' : [O,K,O,K,O,O,O,O,O,O,O,O,O,O],
':Tcl' : [K,K,O,O,O,O,K,O,O,O,O,O,O,O], // both " and { may also be missing
':C' : [O,K,O,O,O,O,O,O,O,O,O,O,O,O],
':VisualSt' : [O,K,O,O,O,O,O,O,O,O,O,O,O,O],
':ECMA-262' : [O,K,O,K,O,O,O,O,O,O,O,O,O,O],
':oldvi' : [O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':vi' : [O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':vim' : [O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':nvi' : [O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':elvis' : [O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':UltraEdit': [K,O,O,O,O,O,O,O,O,O,O,O,O,O],
':UE32_Unix': [K,O,O,O,O,O,O,O,O,O,O,O,O,O],
':ISAPI_rew': [K,O,O,O,K,O,O,O,O,O,O,O,O,O],
':AS3' : [O,O,O,K,O,O,O,O,O,O,O,O,O,O],
':MySQL' : [O,K,O,O,O,O,O,O,O,O,O,O,O,O],
':SQL' : [O,O,O,O,O,O,O,O,O,O,O,O,O,O]
}, // init
raw: {
'desc' : 'list of string literals identifying a raw regex string',
/* first element in array is the delimiter, all following are prefixes
* allowed right before the delimiter to indicate a raw regex string
* delimiter can be a list of characters
*/
// NOTE that this table contains some more languages/flavours, i.e. C#
'fuchur' : '',
//----------+ +-------------------------+,
':BRE' : [],
':ERE' : [],
':POSIX' : [],
':awk' : [],
':gawk' : [],
':bash' : [],
':oldgrep' : [],
':grep' : [],
':ggrep' : [],
':egrep' : [],
':ed' : [],
':ex' : [],
':sed' : [],
':gsed' : [],
':lex' : [],
':flex' : [],
':S-Lang' : [],
':Emacs' : [],
':Erlang' : [],
':Java' : ['"'],
':Java-code': ['"'], // same as Java
':Java-prop': [], // properties files don't get string evaluated
':.NET' : ['"', '@'],
':C#' : ['"', '@'],
':VB.NET' : ['"'],
':VBScript' : ['"'],
//':ModSecurity': ['','@eq', '@streq', '@pmFromFile', '@contains', '@within'],
':ModSecurity': ['','@rx', '@pm', '@validateByteRange'],
// note that first entry is a dummy
':Perl' : ["'", 'qr', 'm'], // perl allows any bracket for qr
':PCRE' : ["'"],
':PHP' : ["'", 'm'],
':Python' : ['"\'', 'r'], // ' and " are identical, just ''' is different
':Ruby' : ['"'], // unsure
':Tcl' : ['{'],
':C' : [],
':VisualSt' : ['"'],
':ECMA-262' : ["'"], // not sure about "
':JavaScript':["'"],
':oldvi' : [],
':vi' : [],
':vim' : [],
':elvis' : [],
':UltraEdit': [],
':UE32_Unix': [],
':ISAPI_rew': [],
':AS3' : [],
':MySQL' : ["'"], // unsure if " or '
':SQL' : [],
':user-regex':["'"]
}, // raw
subs: {
// ToDo: first simple attempt for allowed functions and prefixes
// needs to be in sync with new EnDeRE.parsInit(language) function
/*
*/
'desc' : 'list of functions where RegEx is a parameter (may be a simple prefix too)',
'fuchur' : '',
//----------+ +-------------------------+,
':BRE' : [],
':ERE' : [],
':POSIX' : [],
':awk' : ['sub', 'gsub'],
':gawk' : ['sub', 'gsub'],
':bash' : [],
':oldgrep' : [],
':grep' : [],
':ggrep' : [],
':egrep' : [],
':ed' : [],
':ex' : [],
':sed' : ['s'],
':gsed' : ['s'],
':lex' : [],
':flex' : [],
':S-Lang' : [],
':Emacs' : ['re-search-forward' ],
':Erlang' : ['compile', 'replace', 'run', 'split'],
':Java' : ['compile', 'matcher', 'matches', 'match', 'end', 'find', 'flags', 'group', 'groupCount', 'hasAnchoringBounds', 'hasTransparentBounds', 'hitEnd', 'lookingAt', 'quote', 'quoteReplacement', 'region', 'regionEnd', 'regionStart', 'replaceAll', 'replaceAllRegion', 'replaceFirst', 'requireEnd', 'reset', 'split', 'start', 'text', 'toMatchResult', 'toString', 'useAnchoringBounds', 'usePattern', 'useTransparentBounds' ],
':.NET' : ['Regex', 'IsMatch', 'Matches', 'Match', 'Replace', 'Split', 'Groups', 'ECMAScript' ],
':Perl' : ['m', 's', 'tr', 'q', 'qq', 'qw', 'qr', 'qx' ],
':PCRE' : [],
':PHP' : ['m', 's', 'tr', 'preg_match_all', 'preg_match', 'preg_replace_callback', 'preg_replace', 'preg_split', 'preg_quote', 'preg_grep', 'preg_regex_to_pattern', 'preg_pattern__error', 'preg_regex_error', 'reg_match'],
':Prolog' : ['regmatch', 'regcomp', 'regexec', 'regexpr', 'regsub', 'regsuball' ],
':Python' : ['compile', 'findall' ], // also /regex/ or /regex/.match()
':Ruby' : ['compile', 'gsub', 'scan', 'split', 'escape', 'new', 'quote'],
':Tcl' : ['match', 'regexp', 'regsub', 'regsub -all' ],
':C' : [],
':VisualSt' : [],
':ECMA-262' : ['match', 'replace' ],
':oldvi' : [],
':vi' : [],
':vim' : [],
':elvis' : [],
':UltraEdit': [],
':UE32_Unix': [],
':ISAPI_rew': [],
':AS3' : [],
':MySQL' : ['REGEXP', 'RLIKE'], // REGEXP is not a prefix but a keyword: SELECT 'foobar' REGEXP '^foo';
':SQL' : [],
':usr-regex': []
}, // subs
dot_behavior: {
'desc' : 'behaviour of . (dot) character'
// Friedl 1: St. 183
// match except \n, \r
// does not match \0 in POSIX, Tcl
},
dollar_behavior: {
'desc' : 'behaviour of $ (dollar) character'
// difference for match Word/Line/Text
},
property_behavior: {
'desc' : 'behaviour of p and P (property) character'
// Friedl 3: St. 125
},
backreferences: {
'desc' : 'supported backreferences'
// ERE, gawk, MySQL, flex: keine!
// BRE: \1 .. \9
// Perl: unlimited ( > \9 only if as mutch matches, otherwise it's octal
// Prolog: \1 .. \9
// Python: \1 .. \9, \v10 .. \v99
// but as \v is vertical tab, we need to write \\v10 ..
// AS3: $1 .. $9 $& (matched substring), $` (position before match), $' (string after match)
/* matches:
Emacs, Tcl, Python sopport location (index) of match
*/
},
behavior: {
'desc' : 'misc. behaviours'
/*
'fuchur' : [ 'nonested_paranthese',
'word_character_locale', 'word_character_ASCII',
'' ],
*
nonested_paranthese = [ ':oldgrep', ':grep' ];
noparanthese_quantifier = [ ':oldgrep', ':grep', ':sed' ];
word_character_locale = [ ':ERE', ':POSIX' ];
word_character_ASCII = [ ];
*/
} // behavior
}; //_chrs
this._literal = function() {}; // list of meta string literals
this._literal.prototype = {
'desc' : 'list of supported classes and meta strings',
/* following arrays are generated from _desc.meta above, see EnDeRE.parse()
* they only contain known string literals which are independent of flavours
* if supported by any language/flavour is controled by _chrs.meta{} above
*/
clss : [],
meta : [],
misc : []
}; // _literal
this._context = function() {}; // context where controls, classes and meta are allowed
this._context.prototype = {
ctrl: {
'desc' : 'context where control characters are allowed',
'maxl' : 2, // max number of characters to look ahead
// description of columns
'*' : 'control character supported anywhere',
'(' : 'control character supported insite grouping',
'[' : 'control character supported insite character classes',
//
'fuchur' : '* ( [',
//----------+ +-----+,
':BRE' : [x,x,x],
':ERE' : [x,x,x],
':POSIX' : [x,x,x],
':awk' : [O,O,x],
':gawk' : [O,K,K],
':bash' : [O,O,K],
':oldgrep' : [O,O,O],
':grep' : [O,O,O],
':ggrep' : [x,x,x],
':egrep' : [O,O,O],
':ed' : [O,O,O],