Coccinelle release 0.2.5-rc8
[bpt/coccinelle.git] / tests / regexp.cocci
CommitLineData
951c7801
C
1@anyid@
2type t;
3identifier id;
4fresh identifier new = id ## "_is_an_id";
5@@
6
7t id;
8+t new;
9
10@contains@
11type t;
12identifier anyid.id ~= ".*foo";
13fresh identifier contains = id ##"_contains_foo";
14@@
15
16t id;
17+t contains;
18
19@nocontain@
20type t;
21identifier anyid.id !~= ".*foo";
22fresh identifier nocontain = id ##"_doesn_t_contain_foo";
23@@
24
25t id;
26+t nocontain;
27
28@endsby@
29type t;
30identifier anyid.id ~= ".*foo$";
31fresh identifier endsby = id ##"_ends_by_foo";
32@@
33
34t id;
35+t endsby;
36
37@beginsby@
38type t;
39identifier anyid.id ~= "^foo";
40fresh identifier beginsby = id ##"_begins_by_foo";
41@@
42
43t id;
44+t beginsby;