-6

There is this question that was closed for not being clear: Use grep to find files containing regex patterns

I have found it while searching for a similar issue.

It is not given what is needed to make it clearer. There is no comment towards that. Disappointed it has no real answer (only answer given does not give a resolution), plus closed, I made an edit hoping it would make more sense.

edit is accepted by reviewers, but reverted in just few hours.

@muru now uses this sentence in comments: "the question is definitely not clear enough by any means"

But the question is clear as day for me, yet he is telling me this is "shoehorning my interpretation".

https://chat.stackexchange.com/rooms/149230/discussion-on-question-by-clayton-dukes-use-grep-to-find-files-containing-regex

It is clear I am talking to a wall now, and you can tell everything I may say now feel offended to him just because he rose to a position earlier than me.

What now? Should I just shut up and behave and wait until grumpies leave?

1
  • I don't see any issue with posting essentially the same question, but with a limited scope. For example, about detecting quoted strings containing a backslash followed by a certain set of characters, or finding strings occurring between paired slashes, or any other specific description of how regular expressions usually occur in a specific type of document.
    – Kusalananda Mod
    Oct 21 at 14:04

1 Answer 1

3

Despite what you and Kusalananda say, the question is clear as mud to me. Here are a few questions to determine what you think you understand from that question:

  • Is abc a regex? Why or why not?
  • Is (the empty string) a regex? Why or why not?
  • Are * or ** regular expressions? Why or why not?

If the answer to these questions is yes, why is .* not the regex that matches strings that are regexes? (While we're at it: let's make a stronger claim: it's the only regex to match all regexes.) If the answer to these questions is no, then what do you mean by "regex" (or "regular expression", or "pattern" or whatever you chose to call it)? And whatever be the answer to that, how do you know that's what the OP of that question meant?

12
  • It is clear that they are asking for an expression to match regular expressions. It's too broad as they don't specify in what context the expressions the want to match occurs in. It's too broad rather than unclear. Well, I could possibly agree that this is unclarity too, depending on interpretation, but it has to do with the scope of the question rather than understanding the question. The edit that you reverted did not address the scope, so that revert was all good IMHO.
    – Kusalananda Mod
    Oct 21 at 14:20
  • @Kusalananda on that, where you and I disagree is that to me, OP wants an expression to match something. They have some idea of what that something is, and they think that their idea of that something matches exactly what they call regular expressions. But they and the meta-OP here haven't defined that exactly. It might be that their definition is 'any string that doesn't cause PHP's regex engine to complain'. It might be that it is instead 'any string that describes a possible DFA or NFA using the notation in a given book'. Without that definition, it is not clear what they want to match.
    – muru
    Oct 21 at 14:27
  • Well "I want to find files with ANY regex patterns" is clear, but too broad (to generate any useful answer other than your .* pattern, or indeed test -f filename). But, having said that, I'm agreeing with you that it's unclear what it is they actually want, since they are electing to not show any real input that they want to perform the search in. I'm just echoing what your comment says: They probably have a real issue, but they are unable to present it in a way that would generate useful replies.
    – Kusalananda Mod
    Oct 21 at 14:36
  • (cont.) Whether it's unclear or too broad is not really important; the question should be closed until it is improved upon by the original user.
    – Kusalananda Mod
    Oct 21 at 14:37
  • @muru, what you have just presented so far, are all part of the answer itself. Therefore, they should be presented in an answer, instead of saying "question is not clear". being broad is not the same thing as being unclear. and going back to your first comment on that post, you could ask the OP about this broadness but you chose to make a cryptic know-it-all comment. Oct 24 at 12:25
  • @YılmazDurmaz you can choose to interpret it that way. I disagree. I'd rather have a question with a useful answer than "here's this otherwise useless thing which technically fits your question."
    – muru
    Oct 24 at 12:34
  • @Kusalananda, thanks, "question is already clear but broad". I agree if we can hear from the OP of that question. but a question being "too broad" can always be solved with an exemplary comment or multi-purpose answers. no comment on the post to that, and no answer towards that was given because it is closed. Oct 24 at 12:35
  • @YılmazDurmaz In this case, it's only the original user that could salvage the question. Posting multi-purpose answers would not work well for the same reasons we don't think answers to open-ended questions or questions soliciting opinions are very useful. They tend to turn into dump grounds for answers whose only common denominator is that they circle vaguely around the same keywords.
    – Kusalananda Mod
    Oct 24 at 12:46
  • @YılmazDurmaz As I said in an earlier comment, if you have a similar question but with a more specific context, including examples of real input and expected outputs, which isn't answered with .* (which matches anything and the empty string, because everything and the empty string are all valid regular expression), then, by all means, post that question.
    – Kusalananda Mod
    Oct 24 at 12:48
  • @Kusalananda do you have the right to remove comments? then, can you please remove muru 's and my comments in it and add either add your comment about how to make the question clearer, or give a link here so he may see what to do. wouldn't this be more acceptable solution at the moment? Oct 24 at 13:02
  • 2
    @Kusalananda, "It is clear that they are asking for an expression to match regular expressions" - that wasn't clear to me at all. It's one possible interpretation of the question, which I understood to mean that the OP wanted to identify the set of files containing anything that could be construed as an RE. Since literal text can be an RE that set would be the set of all files and therefore the question doesn't make sense as asked. Ultimately, the question is (correctly, IMO) closed as unclear, but even here it seems there are several ways of looking at the question meaning Oct 26 at 13:02
  • @ChrisDavies Sorry, yes, I should have formulated that as "wants to find files that contains regular expressions", which to me is the same thing as what I said (I expressed this as test -f filename earlier, which is an expression of sorts). I believe that we're basically all repeating each other over and over again.
    – Kusalananda Mod
    Oct 26 at 14:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .