diff options
author | Alejandro Colomar <alx.manpages@gmail.com> | 2022-05-20 04:00:04 +0200 |
---|---|---|
committer | Alejandro Colomar <alx.manpages@gmail.com> | 2022-05-20 04:00:04 +0200 |
commit | e3e43645b2333c8f3bc4297c0e6ce5b491641823 (patch) | |
tree | 6218c246fa895fb8c7f6eda243ba10e1e5c2d57f /bin | |
parent | 52fe165923565b402e1ac7ffb52a134c294a1c8f (diff) |
grepc, grepc.1: -tu: Allow searching special characters
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/grepc | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -327,7 +327,7 @@ grepc_use_enum() grepc_helper \ '\benum\b' \ "\b$1\b" \ - '(?s)^([\w[]+[\w\s]*)?\benum\b\s*([\w\s[\]]|::)*\s*{[^}]*^\s*\w+[\w\s[\]=]*\b'"$1"'\b.*?^}.*?;' \ + '(?s)^([\w[]+[\w\s]*)?\benum\b\s*([\w\s[\]]|::)*\s*{[^}]*^\s*\w+[\w\s[\]=]*'"$1"'.*?^}.*?;' \ <"$files"; } @@ -337,7 +337,7 @@ grepc_use_func_def() grepc_helper \ "\b$1\b" \ '.' \ - '(?s)^[\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+\**\w+\s*\([\w\s\(,\)[\]*]+?(...)?\)\s*{(?:(?!^}).)*\b'"$1"'\b.*?^}' \ + '(?s)^[\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+\**\w+\s*\([\w\s\(,\)[\]*]+?(...)?\)\s*{(?:(?!^}).)*'"$1"'.*?^}' \ <"$files"; } @@ -347,7 +347,7 @@ grepc_linux_use_func_syscall_def() grepc_helper \ "SYSCALL_DEFINE.\(" \ "\b$1\b" \ - '(?s)^(COMPAT_)?SYSCALL_DEFINE.\(\w+\b(?:(?!^}).)*\b'"$1"'\b.?^}' \ + '(?s)^(COMPAT_)?SYSCALL_DEFINE.\(\w+\b(?:(?!^}).)*'"$1"'.?^}' \ <"$files"; } @@ -370,7 +370,7 @@ grepc_use_macro() grepc_helper \ "\b$1\b" \ 'define' \ - '(?s)^[ \t]*#\s*define\s+\w+\b(\([^\)]*\))?(?:(?![^\\]$).)*\b'"$1"'\b.*?[^\\]$' \ + '(?s)^[ \t]*#\s*define\s+\w+\b(\([^\)]*\))?(?:(?![^\\]$).)*'"$1"'.*?[^\\]$' \ <"$files"; } @@ -380,7 +380,7 @@ grepc_use_type_struct_union() grepc_helper \ "\b(struct|union)\b" \ "\b$1\b" \ - '(?s)^(?!^[ \t]*typedef\b)([\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+)?\b(struct|union)\s+\w+\s*[\w\s[\]]*{(?:(?!^}).)*?\b'"$1"'\b.*?^}.*?;' \ + '(?s)^(?!^[ \t]*typedef\b)([\w[]([\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+)?\b(struct|union)\s+\w+\s*[\w\s[\]]*{(?:(?!^}).)*?'"$1"'.*?^}.*?;' \ <"$files"; } @@ -390,7 +390,7 @@ grepc_use_type_typedef_simple() grepc_helper \ '^[ \t]*typedef\s' \ "\b$1\b" \ - '(?s)^[ \t]*typedef\s+[^{};]*\b'"$1"'\b[^{};]+;' \ + '(?s)^[ \t]*typedef\s+[^{};]*'"$1"'[^{};]+;' \ <"$files"; } @@ -400,7 +400,7 @@ grepc_use_type_typedef_struct_union() grepc_helper \ '^[ \t]*typedef\s+(struct|union)\b[^;]*$' \ "\b$1\b" \ - '(?s)^[ \t]*typedef\s+(struct|union)\s+[\w\s[\]]*{(?:(?!^( )?}|^\s*typedef).)*\b'"$1"'\b(?:(?!^( )?}|^\s*typedef).)*^( )?}\s*\w+;' \ + '(?s)^[ \t]*typedef\s+(struct|union)\s+[\w\s[\]]*{(?:(?!^( )?}|^\s*typedef).)*'"$1"'(?:(?!^( )?}|^\s*typedef).)*^( )?}\s*\w+;' \ <"$files"; } |