Skip to contentSkip to conversation

demos: python_regexp: Fix regex matching

PATCH New Himanshu Jha 2 participants 2 messages Jan 15, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 demos: python_regexp: Fix regex matching

Fix regex matching by using correct python syntax by passing the compiled regex object to the argument of search function for effective searching.

---
 demos/python_regexp.cocci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
demos/python_regexp.cocci +1 -1
index ce43367..ffb4bd1 100644
@@ -16,7 +16,7 @@ id << r_init.id;
 @@
 
 print "COCCI: Analyzing %s" % id
-if m.search(id.ident) != None:
+if m.search(id) != None:
 	print "COCCI: %s matchs '_new$'" % id
 else:
 	print "COCCI: %s discarded" % id
Signature · 1 line
2.7.4
Applied
#1 lore raw

PATCH 1/1 demos: python_regexp: Fix regex matching

Quoted 5 lines · Himanshu Jha

Fix regex matching by using correct python syntax by passing the compiled regex object to the argument of search function for effective searching.

Applied, thanks.

julia

Quoted 21 lines
---
 demos/python_regexp.cocci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
demos/python_regexp.cocci +1 -2
index ce43367..ffb4bd1 100644
@@ -16,7 +16,7 @@ id << r_init.id;
 @@
 
 print "COCCI: Analyzing %s" % id
-if m.search(id.ident) != None:
+if m.search(id) != None:
 	print "COCCI: %s matchs '_new$'" % id
 else:
 	print "COCCI: %s discarded" % id
--

2.7.4