I am answering this question. Pattern match without a string order
Assuming the question gets deleted or whatever, here is the question's (lightly) edited text, as of now.
I wanted to match 2 string but the order should't matter e.g. below check should give true instead of false.
final String line = "LIST \"\" (\"car1\" \"car0\") RETURN (SPECIAL-USE STATUS)\n";
final String regex = ".*LIST.*\\(\"car0\"\\ \"car1\"\\)\\ RETURN.*\\R";
System.out.println(line.matches(regex));
I am expecting that values in string line should match with regex irrespective of the order of the words(car1 and car0).
The question isn't great, but an attempt was clearly made, and the example is simple and reproducible. However, the Community bot responded with the following comment.
Please provide enough code so others can better understand or reproduce the problem.
So, I decided to try and flag the bot, since it was clearly incorrect. After all, copy and paste the above code into a main method, and you get the exact output that the user described. If the bot had something like Show your multiple attempts at solving the problem or Explain why you think it doesn't work, I would be more understanding.
But when I tried to flag the bot, the only option that popped up said the following.
Why are you flagging this comment?
- It's no longer needed. -- This comment is outdated, conversational, or not relevant to this post.
But that's not accurate at all. In fact, it should instead say something like Question was incorrectly flagged as lacking a code example.
Is there any way we could add an option to the flag menu that better captures why the bot's comment is being flagged?
Screenshot -- https://i.stack.imgur.com/7ziIv.png
Edit options -- https://i.stack.imgur.com/H61ER.png