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