File: rx_charclass

package info (click to toggle)
nqp 2022.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,436 kB
  • sloc: java: 28,030; perl: 3,394; ansic: 451; makefile: 200; javascript: 68; sh: 1
file content (42 lines) | stat: -rw-r--r-- 1,766 bytes parent folder | download | duplicates (6)
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
##   Enumerated character lists
[c]			abcdef		y	character class
[dcb]{3}		abcdef		y	repeated character class
^[a]			abcdef		y	anchored character class
[^e]			abcdef		y	negated character class
^[a]?			abcdef		y	anchored optional character class
[^e]?			abcdef		y	negated optional character class
[^dcb]{3}		abcdef		n	repeated negated character class
^[^e]			abcdef		y	anchored negated character class
^[^a]			abcdef		n	anchored negated character class
[b-d]		abcdef		y	character range
[b-d]		abxxef		y	character range
[b-d]		axcxef		y	character range
[b-d]		axxdef		y	character range
[b-d]		axxxef		n	character range
[^b-d]		abcdef		y	negated character range
[-]			ab-def		y	unescaped hyphen, the only thing
[x-]			ab-def		y	unescaped hyphen, at the end
[-x]			ab-def		y	unescaped hyphen, at the beginning
[\-]			ab-def		y	escaped hyphen
[\-]			abcdef		n	escaped hyphen
[^\-]			---x--		y	negated escaped hyphen
[^\-]			------		n	negated escaped hyphen
[\-+]			ab-def		y	escaped hyphen in range
[\-+]			ab+def		y	escaped hyphen in range
[\-+]			abcdef		n	escaped hyphen in range
[+\-]			ab-def		y	escaped hyphen in range
[+\-]			ab+def		y	escaped hyphen in range
[+\-]			abcdef		n	escaped hyphen in range
[^\-+]		---x--		y	negated escaped hyphen in range
[^\-+]		------		n	negated escaped hyphen in range
[^+\-]		---x--		y	negated escaped hyphen in range
[^+\-]		------		n	negated escaped hyphen in range
["\\]			\\			y	escaped backslash
[\]]			]			y	escaped close bracket
[A-Z0-9]		abcdef		n	two enumerated ranges
[A-Z0-9]		abcDef		y	two enumerated ranges
a[[]b		a[b		y	first char of charclass special
a[[]b		ab		n	first char of charclass special
a[]]b		a]b		y	first char of charclass special
a[]]b		ab		n	first char of charclass special
a]			a]		y	unmatched ] is ok