Coccinelle release-1.0.0-rc11
[bpt/coccinelle.git] / globals / regexp_str.ml
index 558a47b..3823e0a 100644 (file)
@@ -1,5 +1,7 @@
 (*
- * Copyright 2010, INRIA, University of Copenhagen
+ * Copyright 2012, INRIA
+ * Julia Lawall, Gilles Muller
+ * Copyright 2010-2011, INRIA, University of Copenhagen
  * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix
  * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
  * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
@@ -32,6 +34,5 @@ let regexp string =
 
 let string_match regexp string =
   try
-       Str.search_forward regexp string 0;
-       true
+    Str.search_forward regexp string 0 >= 0
   with _ -> false