0

How does one escape special characters in the cscope "Find this egrep pattern" ? For instance I want to find everywhere in a huge codebase where I have the statement

print("\n[<something>.....

I need to find every line where a print format specifier string has a newline immediately followed by a left bracket character.

How do I feed this to the egrep pattern search?

I tried:

Find this egrep pattern: \\n[
Find this egrep pattern: \\n\[

got :

Egrep Syntax error in this pattern: \n[
Could not find the egrep pattern: \\n\[
Andrew Ward
  • 171
  • 2
  • 13

2 Answers2

0

I use cscope version 15.8b, using the pattern \\n\[ will match the string you want.

P.S., the "egrep" in cscope might confuse us. As the bugzilla page I googled, it is a little implementation of "extended" regular expression, its behavior might be not the same with egrep util of Linux command line.

Vincent
  • 1
  • 2
0

Place the special characters to be searched within [ ] brackets.

Example:

Find this egrep pattern:

print[("\]n

Vicky
  • 431
  • 1
  • 6
  • 12