In OpenGrok, how do you do a full search for special characters without alphanumeric characters?

I am trying to find my codebase for code that calls a function called "foo", so I search for "foo (", but the results I get include everything with the word foo in it, which includes css, comments, and lines that don't even have a closing parenthesis.

Does anyone know how to search for strings containing special characters such as ),"' ?

+5
source share
2 answers

When searching for special characters, try using the escape character before the character, i.e. \, eg. "foo \ (".

In addition, I found the answer to a similar question (see http://marc.info/?l=opensolaris-opengrok-discuss&m=115776447032671 ). It seems that common special characters are not indexed due to performance issues, so it may not be possible to efficiently look for such a pattern.

0
source

Opengrok supports escaping special characters that are part of the query syntax. Current special characters: + - && ||! () {} [] ^ "~ * ?: \ /

To avoid these characters, use the \ character before the character. For example, to search for (1 + 1): 2, use the query \ (1 \ +1) \: 2

0
source

Source: https://habr.com/ru/post/1210150/


All Articles