-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCursor.regex.txt
30 lines (30 loc) · 1.48 KB
/
Cursor.regex.txt
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
# Matches an ANSI cursor control
\e\[(?>
(?<DeviceStatusReport>6n) # 6n will request the cursor position
|
(?<CursorPosition>(?<Row>\d+)\;(?<Column>\d+)R) # A Device Status Report will return CursorPosition in the form <row>;<column> R
|
(?<CursorUp>(?<RowCount>\d+)A) # Cursor Up is a digit followed by A
|
(?<CursorDown>(?<RowCount>\d+)B) # Cursor Down is a digit followed by B
|
(?<CursorForward>(?<ColumnCount>\d+)C) # Cursor Forward is a digit followed by C
|
(?<CursorBack>(?<ColumnCount>\d+)D) # Cursor Back is a digit followed by D
|
(?<CursorNextLine>(?<LineCount>\d+)E) # Cursor Next Line is a digit followed by E
|
(?<CursorNextLine>(?<LineCount>\d+)F) # Cursor Next Line is a digit followed by F
|
(?<CursorAbsolute>(?<AbsolutePosition>\d+)G) # Cursor Absolute Position is a digit followed by G
|
(?<CursorPosition>(?<Row>\d{0,})\;(?<Column>\d{0,})H) # Cursor Positions are two optional digits, separated by semicolon, ending with H
|
(?<ScrollUp>(?<PageCount>\d+)S) # Scroll Up is a digit followed by S
|
(?<ScrollDown>(?<PageCount>\d+)T) # Scroll Down is a digit followed by T
|
(?<CursorHide>25h) # Cursors can be hidden with 25h
|
(?<CursorShow>25l) # Cursors can be hidden with 25l
)