The regular expression is (\\w+).*>(.{23}) ([^\\[]+)\\[([^\\]]+)]: (.+)
Pattern pattern = Pattern.compile("(\\w+).*>(.{23}) ([^\\[]+)\\[([^\\]]+)]: (.+)")
String s = "xxxxxx"; //this is what I want
Matcher matcher = pattern.matcher(s);
System.out.println(matcher.find()); // I hope "true"
Maybe it’s not suited to ask for help here. But I am not expert in regular expression and I need to know the result quickly.
I reduced the complexity and tried some schemes .
abbb>(ccccccccccccccccccccddddddddddcc)is OK to(\\w+).*>(.{23})(\\a)is OK to([^\\[]+)
but if I combine them.
abbb>(ccccccccccccccccccccddddddddddcc) (\\a) is not OK to (\\w+).*>(.{23}) ([^\\[]+)
So I am confused, especially the ([^\\[]+)\\[([^\\]]+)]: (.+) part.
Thanks .
Your question is very unclear, but if you needed strings to match your regular expression, I made some for you:
all of them match
"(\\w+).*>(.{23}) ([^\\[]+)\\[([^\\]]+)]: (.+)"and that list was generated by some code i wrote up real quick: