File: regex.xml

package info (click to toggle)
jedit 5.3.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 14,252 kB
  • ctags: 11,190
  • sloc: java: 98,480; xml: 94,070; makefile: 52; sh: 42; cpp: 6; python: 6
file content (121 lines) | stat: -rw-r--r-- 3,619 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
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
<?xml version="1.0"?>

<!DOCTYPE MODE SYSTEM 'xmode.dtd'>

<!-- Regular Expression mode, by Kevin Hunter -->

<!-- Currently implemented artifacts:
***** Classes
[...] - user-defined character classes
\d - Numerical characters (eq. [0-9])
\D - Non-numerical characters (eq. [^0-9])
\w - Alphanumeric characters and underscore (eq. [A-Za-z0-9_])
\W - Opposite of \w (eq. [^A-Za-z0-9_])
\s - Whitespace characters (ex. space, tab, formfeed, newline)
\S - Non-whitespace characters
\b - Word-break character
.  - Any character, generally not including a newline (\n)

***** Operators
^ - Match at beginning of string
$ - Match at end of string
? - optionally match previous item token
* - Match previous token 0 or more times.
+ - Match previous token 1 or more times.
| - Logical OR, allowing the previous token or next token to match
{m} - Match previous token exactly m times.
{m,} - Match previous token at least m times
{m,n} - Match previous token between m and n times, inclusive.

***** Functions
[^...] - negate user-defined character classes
(...) - Backreference - effectively save the matched part for later use
(?:...) - Group - Don't save, just mark the section of the pattern as a group
(?=...) - zero-width positive lookahead assertion
(?!...) - zero-width negative lookahead assertion
(?<=...) - zero-width positive lookbehind assertion
(?<!...) - zero-width negative lookbehind assertion

-->
<MODE>
	<RULES IGNORE_CASE='FALSE' HIGHLIGHT_DIGITS='TRUE' SET='FORCED_NUMBER'>
		<SEQ TYPE='OPERATOR'>,</SEQ>
	</RULES>

	<RULES IGNORE_CASE='FALSE' HIGHLIGHT_DIGITS='TRUE'>
		<SEQ TYPE='NULL'>\\</SEQ>
		<SEQ TYPE='NULL'>\(</SEQ>
		<SEQ TYPE='NULL'>\)</SEQ>
		<SEQ TYPE='NULL'>\[</SEQ>
		<SEQ TYPE='NULL'>\]</SEQ>
		<SEQ TYPE='NULL'>\{</SEQ>
		<SEQ TYPE='NULL'>\}</SEQ>
		<SEQ TYPE='NULL'>\^</SEQ>
		<SEQ TYPE='NULL'>\$</SEQ>
		<SEQ TYPE='NULL'>\?</SEQ>
		<SEQ TYPE='NULL'>\+</SEQ>
		<SEQ TYPE='NULL'>\*</SEQ>
		<SEQ TYPE='NULL'>\.</SEQ>
		<SEQ TYPE='NULL'>\|</SEQ>

		<SEQ TYPE='OPERATOR'>^</SEQ>
		<SEQ TYPE='OPERATOR'>$</SEQ>
		<SEQ TYPE='OPERATOR'>?</SEQ>
		<SEQ TYPE='OPERATOR'>*</SEQ>
		<SEQ TYPE='OPERATOR'>+</SEQ>
		<SEQ TYPE='OPERATOR'>|</SEQ>

		<SEQ TYPE='KEYWORD1'>\b</SEQ>

		<SEQ TYPE='DIGIT'>\d</SEQ>
		<SEQ TYPE='LITERAL2'>\D</SEQ>

		<SEQ TYPE='KEYWORD3'>\w</SEQ>
		<SEQ TYPE='KEYWORD3'>.</SEQ>
		<SEQ TYPE='LITERAL3'>\W</SEQ>

		<SEQ TYPE='KEYWORD4'>\s</SEQ>
		<SEQ TYPE='LITERAL4'>\S</SEQ>

		<SPAN TYPE='FUNCTION' DELEGATE='MAIN'>
			<BEGIN>[^</BEGIN> <!-- user-defined negative character class -->
			<END>]</END>
		</SPAN>

		<SPAN TYPE='FUNCTION' DELEGATE='MAIN'>
			<BEGIN>(?=</BEGIN> <!-- zero-width positive lookahead assertion -->
			<END>)</END>
		</SPAN>
		<SPAN TYPE='FUNCTION' DELEGATE='MAIN'>
			<BEGIN>(?!</BEGIN> <!-- zero-width negative lookahead assertion -->
			<END>)</END>
		</SPAN>
		<SPAN TYPE='FUNCTION' DELEGATE='MAIN'>
			<BEGIN><![CDATA[(?<=]]></BEGIN> <!-- zero-width positive lookbehind assertion -->
			<END>)</END>
		</SPAN>
		<SPAN TYPE='FUNCTION' DELEGATE='MAIN'>
			<BEGIN><![CDATA[(?<!]]></BEGIN> <!-- zero-width negative lookbehind assertion -->
			<END>)</END>
		</SPAN>
		<SPAN TYPE='FUNCTION' DELEGATE='MAIN'>
			<BEGIN>(?:</BEGIN> <!-- unsaved group -->
			<END>)</END>
		</SPAN>

		<SPAN TYPE='OPERATOR' DELEGATE='FORCED_NUMBER'>
			<BEGIN>{</BEGIN>
			<END>}</END>
		</SPAN>
		<SPAN TYPE='OPERATOR' DELEGATE='MAIN'>
			<BEGIN>[</BEGIN> <!-- user-defined character class -->
			<END>]</END>
		</SPAN>
		<SPAN TYPE='FUNCTION' DELEGATE='MAIN'>
			<BEGIN>(</BEGIN> <!-- saved group (backreference) -->
			<END>)</END>
		</SPAN>
	</RULES>

</MODE>