eclipse plugin: escape regex specific characters (if any)

This commit is contained in:
Timotei Dolean 2010-06-12 20:25:17 +00:00
parent 4e0b513143
commit 982fd5dcc8

View file

@ -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();
}
}
}