mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-18 16:04:16 +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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user