mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-18 09:53:32 +00:00
eclipse plugin: escape regex specific characters (if any)
This commit is contained in:
parent
4e0b513143
commit
982fd5dcc8
@ -9,7 +9,7 @@ import java.util.regex.Pattern;
|
||||
public class StringUtils {
|
||||
public static boolean startsWith(String target, String sequence)
|
||||
{
|
||||
Pattern pattern = Pattern.compile("[\t| ]*"+sequence);
|
||||
Pattern pattern = Pattern.compile("[\t| ]*\\"+sequence);
|
||||
Matcher matcher = pattern.matcher(target);
|
||||
return (matcher.find() && matcher.start() == 0);
|
||||
}
|
||||
@ -90,4 +90,4 @@ public class StringUtils {
|
||||
}
|
||||
return resString.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user