@@ -6,44 +6,42 @@ import "regexp"
6
6
t1: regexp.Find(#"f\w\w"#, "afoot")
7
7
t2: regexp.Find(#"f\w\w"#, "bar")
8
8
t3: regexp.FindAll(#"f\w\w"#, "afoot afloat from", 2)
9
- t4: regexp.FindAll(#"f\w\w"#, "afoot afloat from", 2)
10
- t5: regexp.FindAll(#"f\w\w"#, "bla bla", -1)
11
- t6: regexp.FindSubmatch(#"f(\w)(\w)"#, "afloat afoot from")
12
- t7: regexp.FindAllSubmatch(#"f(\w)(\w)"#, "afloat afoot from", -1)
13
- t8: regexp.FindAllSubmatch(#"f(\w)(\w)"#, "aglom", -1)
14
- t9: regexp.FindNamedSubmatch(#"f(?P<A>\w)(?P<B>\w)"#, "afloat afoot from")
15
- t10: regexp.FindAllNamedSubmatch(#"f(?P<A>\w)(?P<B>\w)"#, "afloat afoot from", -1)
16
- t11: regexp.FindAllNamedSubmatch(#"f(?P<A>optional)?"#, "fbla", -1)
17
- t12: regexp.FindAllNamedSubmatch(#"f(?P<A>\w)(?P<B>\w)"#, "aglom", -1)
18
- t13: regexp.Valid & "valid"
19
- t14: regexp.Valid & "invalid)"
9
+ t4: regexp.FindAll(#"f\w\w"#, "bla bla", -1)
10
+ t5: regexp.FindSubmatch(#"f(\w)(\w)"#, "afloat afoot from")
11
+ t6: regexp.FindAllSubmatch(#"f(\w)(\w)"#, "afloat afoot from", -1)
12
+ t7: regexp.FindAllSubmatch(#"f(\w)(\w)"#, "aglom", -1)
13
+ t8: regexp.FindNamedSubmatch(#"f(?P<A>\w)(?P<B>\w)"#, "afloat afoot from")
14
+ t9: regexp.FindAllNamedSubmatch(#"f(?P<A>\w)(?P<B>\w)"#, "afloat afoot from", -1)
15
+ t10: regexp.FindAllNamedSubmatch(#"f(?P<A>optional)?"#, "fbla", -1)
16
+ t11: regexp.FindAllNamedSubmatch(#"f(?P<A>\w)(?P<B>\w)"#, "aglom", -1)
17
+ t12: regexp.Valid & "valid"
18
+ t13: regexp.Valid & "invalid)"
20
19
-- out/regexp --
21
20
Errors:
22
- t14 : invalid value "invalid)" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: unexpected ): `invalid)`:
23
- ./in.cue:16 :21
21
+ t13 : invalid value "invalid)" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: unexpected ): `invalid)`:
22
+ ./in.cue:15 :21
24
23
error in call to regexp.Find: no match:
25
24
./in.cue:4:5
26
25
error in call to regexp.FindAll: no match:
27
- ./in.cue:7 :5
26
+ ./in.cue:6 :5
28
27
error in call to regexp.FindAllSubmatch: no match:
29
- ./in.cue:10 :5
28
+ ./in.cue:9 :5
30
29
error in call to regexp.FindAllNamedSubmatch: no match:
31
- ./in.cue:14 :6
30
+ ./in.cue:13 :6
32
31
33
32
Result:
34
33
t1: "foo"
35
34
t2: _|_ // error in call to regexp.Find: no match
36
35
t3: ["foo", "flo"]
37
- t4: ["foo", "flo"]
38
- t5: _|_ // error in call to regexp.FindAll: no match
39
- t6: ["flo", "l", "o"]
40
- t7: [["flo", "l", "o"], ["foo", "o", "o"], ["fro", "r", "o"]]
41
- t8: _|_ // error in call to regexp.FindAllSubmatch: no match
42
- t9: {
36
+ t4: _|_ // error in call to regexp.FindAll: no match
37
+ t5: ["flo", "l", "o"]
38
+ t6: [["flo", "l", "o"], ["foo", "o", "o"], ["fro", "r", "o"]]
39
+ t7: _|_ // error in call to regexp.FindAllSubmatch: no match
40
+ t8: {
43
41
A: "l"
44
42
B: "o"
45
43
}
46
- t10 : [{
44
+ t9 : [{
47
45
A: "l"
48
46
B: "o"
49
47
}, {
@@ -53,10 +51,10 @@ t10: [{
53
51
A: "r"
54
52
B: "o"
55
53
}]
56
- t11 : [{
54
+ t10 : [{
57
55
A: ""
58
56
}]
59
- t12 : _|_ // error in call to regexp.FindAllNamedSubmatch: no match
60
- t13 : "valid"
61
- t14 : _|_ // t14 : invalid value "invalid)" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: unexpected ): `invalid)`
57
+ t11 : _|_ // error in call to regexp.FindAllNamedSubmatch: no match
58
+ t12 : "valid"
59
+ t13 : _|_ // t13 : invalid value "invalid)" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: unexpected ): `invalid)`
62
60
0 commit comments