我一直在努力学习正则表达式;但是,我似乎无法理解这两个正则表达式在说什么。
private static final Pattern BALANCED_TEXT =
Pattern.compile("(?s)((?:\\\\.|[^\\\\{}]"
+ "|[{](?:\\\\.|[^\\\\{}])*[}])*)"
+ "\\}"
+ "|.");
private static final Pattern INPUT_PATTERN =
Pattern.compile("(?s)(\\p{Blank}+)"
+ "|(\\r?\\n((?:\\r?\\n)+)?)"
+ "|\\\\([\\p{Blank}{}\\\\])"
+ "|\\\\(\\p{Alpha}+)([{]?)"
+ "|((?:[^\\p{Blank}\\r\\n\\\\{}]+))"
+ "|(.)");
如果有人能深入地向我解释这两个正则表达式语句,我将不胜感激。提前致谢!