-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathre.bas
More file actions
61 lines (54 loc) · 2.07 KB
/
re.bas
File metadata and controls
61 lines (54 loc) · 2.07 KB
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
'
' FILE: re.bas
'
' This is the module declaration of the ScriptBasic external module re
'
' To use this module you have to have re.dll or re.so installed in the
' modules directory.
'
' These implement the interface to the hsregex regular expression package
module re
declare sub ::match alias "match" lib "re"
declare sub ::m alias "match" lib "re"
declare sub ::n alias "nmatch" lib "re"
declare sub ::dollar alias "dollar" lib "re"
declare sub ::$ alias "dollar" lib "re"
declare sub ::format alias "format" lib "re"
declare sub ::reset alias "reset" lib "re"
declare sub ::replace alias "replace" lib "re"
declare sub ::s alias "replace" lib "re"
Const CaseInsensitive = &HFFFFFFFE
Const MultiLine = &HFFFFFFFD
Const ErrorNoMatch = &H00080001
Const ErrorBadPat = &H00080002
Const ErrorCollate = &H00080003
Const ErrorCType = &H00080004
Const ErrorEscape = &H00080005
Const ErrorSubReg = &H00080006
Const ErrorBrack = &H00080007
Const ErrorParen = &H00080008
Const ErrorBrace = &H00080009
Const ErrorBadBr = &H0008000A
Const ErrorRange = &H0008000B
Const ErrorSpace = &H0008000C
Const ErrorBadRpt = &H0008000D
Const ErrorEmpty = &H0008000E
Const ErrorAssert = &H0008000F
Const ErrorInvArg = &H00080010
' REG_NOMATCH regexec() failed to match
' REG_BADPAT invalid regular expression
' REG_ECOLLATE invalid collating element
' REG_ECTYPE invalid character class
' REG_EESCAPE \ applied to unescapable character
' REG_ESUBREG invalid backreference number
' REG_EBRACK brackets [ ] not balanced
' REG_EPAREN parentheses ( ) not balanced
' REG_EBRACE braces { } not balanced
' REG_BADBR invalid repetition count(s) in { }
' REG_ERANGE invalid character range in [ ]
' REG_ESPACE ran out of memory
' REG_BADRPT ?, *, or + operand invalid
' REG_EMPTY empty (sub)expression
' REG_ASSERT ``can't happen''-you found a bug
' REG_INVARG invalid argument, e.g. negative-length string
end module