-
Notifications
You must be signed in to change notification settings - Fork 4
/
regex.f90
47 lines (30 loc) · 824 Bytes
/
regex.f90
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
module regex
implicit none
private
public :: new_re, match_re, sub_re
type token
character (len=1) :: literal
integer :: ttype
end type
integer, parameter :: LITERAL = 0
integer, parameter :: STAR = 1
integer, parameter :: ENDANCH = 2
integer, parameter :: STARTANCH = 3
integer, parameter :: DEBUG_CHANNEL = 25
logical, save :: debug = .false.
contains
function new_re (regex_str)
character (len=*) :: regex_str
character (len=250) :: new_re
end function new_re
function match_re (regex, str)
character (len=250) :: regex
character (len=*) :: str
logical :: match_re
end function match_re
function sub_re (regex, str)
character (len=250) :: regex
character (len=*) :: str
logical :: sub_re
end function sub_re
end module regex