* [Cocci] [PATCH] demos: python_regexp: Fix regex matching
@ 2018-01-15 12:36 Himanshu Jha
2018-01-15 20:29 ` Julia Lawall
0 siblings, 1 reply; 2+ messages in thread
From: Himanshu Jha @ 2018-01-15 12:36 UTC (permalink / raw)
To: cocci
Fix regex matching by using correct python syntax by passing the
compiled regex object to the argument of search function for effective
searching.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
---
demos/python_regexp.cocci | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/demos/python_regexp.cocci b/demos/python_regexp.cocci
index ce43367..ffb4bd1 100644
--- a/demos/python_regexp.cocci
+++ b/demos/python_regexp.cocci
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cocci] [PATCH] demos: python_regexp: Fix regex matching
2018-01-15 12:36 [Cocci] [PATCH] demos: python_regexp: Fix regex matching Himanshu Jha
@ 2018-01-15 20:29 ` Julia Lawall
0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2018-01-15 20:29 UTC (permalink / raw)
To: cocci
On Mon, 15 Jan 2018, Himanshu Jha wrote:
> Fix regex matching by using correct python syntax by passing the
> compiled regex object to the argument of search function for effective
> searching.
>
> Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Applied, thanks.
julia
> ---
> demos/python_regexp.cocci | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/demos/python_regexp.cocci b/demos/python_regexp.cocci
> index ce43367..ffb4bd1 100644
> --- a/demos/python_regexp.cocci
> +++ b/demos/python_regexp.cocci
> @@ -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
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-15 20:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-15 12:36 [Cocci] [PATCH] demos: python_regexp: Fix regex matching Himanshu Jha
2018-01-15 20:29 ` Julia Lawall
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.