Regular Expressions 101

Community Patterns

Community Library Entry

-1

Regular Expression
Python

r"
(?P<left>\{.*(?P<buffer_declaration>char\s+(?P<buffer_name>\w+)\[(?P<buffer_size>\d+)]\s*;).*?)(?P<insert_place>\s)(?P<right>(?P<printing_buffer>\w*pr\w*\(\s*\".*?\"[^)]*?(?P=buffer_name).*\)\s*;).*})
"
gms

Description

This regex checks if c/c++ code contains char buffer that is later printed.

Submitted by tagoras - 2 years ago