I'm using pcregrep to search for a multiline pattern, and I only want pcregrep to search through files with specific file extensions, i.e.
pcregrep -Mrl --include=*.sv -e '<my_multi-line_pattern>' /path/to/search
However, this throws an error: pcregrep: Error in 'include' regex at offset 0: nothing to repeat
.
I've tried escaping & double-escaping the *
to no avail. This syntax seems to work just fine for grep
grep -rl --include=*.sv '<my_single-line_pattern>' /path/to/search
Any help or hints greatly appreciated.
EDIT: Example multi-line pattern: '(?s)^\salu.*\.opa_i('
should match
alu u_alu(
...
.opa_i(opa),
.opb_i(opb),
...
)