mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
GP-2317 - Fixed bug in unescaped regex characters
This commit is contained in:
parent
1df11c6cb0
commit
b218028647
2 changed files with 11 additions and 10 deletions
|
@ -40,8 +40,7 @@ public class UserSearchUtils {
|
|||
private final static char[] GLOB_CHARACTERS = { '*', '?' };
|
||||
|
||||
/**
|
||||
* A pattern that will find all '\' chars that are not followed by '*', '?'
|
||||
* or another '\'
|
||||
* A pattern that will find all '\' chars that are not followed by '*', '?' or another '\'
|
||||
*/
|
||||
public final static Pattern NON_GLOB_BACKSLASH_PATTERN = Pattern.compile("\\\\(?![\\*\\?])");
|
||||
|
||||
|
@ -383,11 +382,12 @@ public class UserSearchUtils {
|
|||
*
|
||||
* @param input
|
||||
* The input string to be escaped
|
||||
* @param doNotEscape an array of characters that should not be escaped
|
||||
* @return A new regex string with special characters escaped.
|
||||
*/
|
||||
// note: 'package' for testing
|
||||
static String escapeSomeRegexCharacters(String input, char[] doNotEscape) {
|
||||
StringBuffer buffy = new StringBuffer();
|
||||
StringBuilder buffy = new StringBuilder();
|
||||
for (int i = 0; i < input.length(); i++) {
|
||||
char c = input.charAt(i);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue