удаление отладочной печати сравнения и не только
This commit is contained in:
@@ -13,8 +13,6 @@ public class StringTemplate {
|
||||
public StringTemplate(String p, String s) {
|
||||
prefix = Utils.pack(p);
|
||||
suffix = Utils.pack(s);
|
||||
// System.out.println(Utils.Brackets(prefix));
|
||||
// System.out.println(Utils.Brackets(suffix));
|
||||
String[] prefix_words = prefix.split(" ");
|
||||
String[] suffix_words = suffix.split(" ");
|
||||
//настраиваем регулярное выражение----------
|
||||
@@ -37,25 +35,16 @@ public class StringTemplate {
|
||||
return text_in.substring(m.start(), m.end());
|
||||
}
|
||||
public boolean check(String text_in) {
|
||||
// System.out.println("sentense = " + Utils.Brackets(text_in));
|
||||
// System.out.println("pattern = " + Utils.Brackets(pattern));
|
||||
return Pattern.compile(pattern, Pattern.CASE_INSENSITIVE | Pattern.MULTILINE).matcher(text_in).find();
|
||||
}
|
||||
public String check_and_get_param(String text_in) {
|
||||
Pattern regex = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
|
||||
Matcher matcher = regex.matcher(text_in);
|
||||
// System.out.println("sentense = " + Utils.Brackets(text_in));
|
||||
// System.out.println("pattern = " + Utils.Brackets(pattern));
|
||||
if (matcher.find()) {
|
||||
// System.out.println("match found " + matcher.start() + " " + matcher.end());
|
||||
String sentence = text_in.substring(matcher.start(), matcher.end());
|
||||
// System.out.println("sentence=" + Utils.Brackets(sentence));
|
||||
String prefix_ = getFirstMatch(prefix, sentence);
|
||||
// System.out.println("prefix_ = " + Utils.Brackets(prefix_));
|
||||
String suffix_ = getFirstMatch(suffix, sentence);
|
||||
// System.out.println("suffix_ = " + Utils.Brackets(suffix_));
|
||||
String param = sentence.substring(prefix_.length(), sentence.length() - suffix_.length());
|
||||
// System.out.println("param = " + Utils.Brackets(param));
|
||||
return param;
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user