-18

A few days ago, I asked a question on another Stack Overflow forum. It got closed a couple of days later.

However, it seems clear that I have provided all the information that was claimed missing for others to provide answers for me. For example, I did include what was the expected behavior and how did it fail (produced no output / matches).

So what gives? Was my question closed by an AI of sorts? If so, it needs serious upgrading. Was it closed by a human? If so, this human did not appear to read my question. How could this kind of carelessness be monitored and regulated?

11
  • 2
    "Was my question closed by an AI of sorts?" There isn't any AI / bot closing questions on Stack Overflow. If you do find or believe someone is running such a bot to cast close votes you should raise a moderator flag since automation for such things is not allowed. Your question was closed by votes from 3 users. May 8 at 4:13
  • 3
    Here's some points that are not obvious from your question which the close voters might have wanted clarification on. In <blah blah blah>stuff<blah blah blah> does the opening tag and the closing tag have to be exactly the same, or anything is fine (You seem to be trying to parse some HTML / XML)? In your regex <{1}.*>{1} what are you trying to do with those {1}? One of the comments also asked you for some sample data so that your requirements would be more clear. May 8 at 4:20
  • 1
    Additionally, in a comment to Bohemian's answer you mention Vim and Notepad++. Since these two editors use different regex syntax, it would be better to choose one of them and specify it in the question.
    – duplode
    May 8 at 4:53
  • 2
    In your own words, where it says <{1}.*>{1}, exactly what do you expect this to mean, piece by piece? Specifically, what do you expect {1} to mean in this context? We can only possibly explain what is wrong with your reasoning, if we understand what your reasoning is. May 8 at 5:51
  • 5
    I can speculate that "when in fact it isn't" is earning you more downvotes than this would otherwise deserve. Asking for an explanation is fine, though inevitably, on Meta, you will also receive downvotes simply for not having searched for earlier similar questions.
    – tripleee
    May 8 at 5:59
  • 11
    Let me echo the last paragraph slightly altered back to you: So what gives? Was your question written by an AI of sorts? If so, it needs serious upgrading. Was it written by a human? If so, this human did not appear to read existing guidance. How could this kind of carelessness be monitored and regulated? If you feel insulted then at least we have something in common.
    – rene
    May 8 at 7:58
  • 3
    @tripleee: "If so, this human did not appear to read my question" doesn't help either...
    – Jon Skeet
    May 8 at 8:34
  • 6
    I don't really understand what you mean by "on another Stack Overflow forum" because Stack Overflow is not a forum and you asked it on Stack Overflow.
    – Dharman Mod
    May 8 at 9:06
  • Related (also about matching 'angle markup' content with regular expressions): Please stop linking to the "Zalgo" / anti-Cthulhu regex rant"parsing HTML with the help of regex, while possible in some regex flavors, should be highly discouraged. " May 8 at 11:49
  • A similar question on Super User: Non-greedy regular expression to convert command tags May 8 at 12:08
  • Similar questions on Unix & Linux (but not using text editors): Text between two tags and Shell script to remove child XML tags conditionally May 8 at 12:34

1 Answer 1

15

I can only account for my own close vote, but I voted to close as requiring details or clarity. Ultimately, the post was closed as requiring debugging details, which I also agree with; when there are multiple different close votes, the majority reason is what gets displayed to the author of the post. On Stack Overflow, when a post accrues three close votes, it gets closed.

Like the tag info reveals, and gets displayed (very briefly) when you select this tag, we need to know which environment you need a regular expression for. Like you discovered, what works in one might not work in another. See also Why are there so many different regular expression dialects?

Furthermore, your exposition does not reveal in enough detail what result you expect. It's important to include this information for us to understand what you are really looking for, especially when the prose description of your problem is vague.

The notice which is displayed on top of your post links to the close reason with several links to more information about how to address the problems with your post and what's expected on Stack Overflow.

Closed. This question needs debugging details. It is not currently accepting answers.

Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.

Probably also review the help center and in particular How to ask as well as the regex tag info page.

Your post was edited by a helpful bystander to include some details which you only had revealed in comments, at which point the post was added to the review queue for reopening; but I personally don't think it is yet clear enough to warrant my vote to reopen it. Once you clarify it sufficiently, it can be reopened and answered (though your question seems like it's probably already answered many times, including in the tag info page, in which case reopening it only to have it be closed again as a duplicate is pointless).

In general, your question should be self-contained; even if somebody asks for a clarification in a comment, it's better to update the question itself, rather than respond with another comment. Comments are intended to be temporary, and can be deleted at any moment.

The fact that you received two different answers (one of which is deleted now) should also help you see how your question is ambiguous; the deleted answer probably is closer to what you actually want, but is based on speculation around your prose description, whereas the remaining answer is closer to answering what you currently seem to be asking.

"It doesn't work" is a red flag for many of us; it sounds like you get no result at all, but that can't be true, because the regular expression you tried should match something (though this too depends on which precise regular expression tool you are using and what your input data looks like). What results exactly do you get, and how do they differ from what you expect? Can you provide example data and the current as well as the desired result?

Attempting to use regular expressions to process XML-like formats is often misdirected. See also Why it's not possible to use regex to parse HTML/XML: a formal explanation in layman's terms

All of these points have been covered many, many times in the past. We do ask newcomers to spend some time learning how to use the site, and on investigating their problem in a search engine before asking.

6
  • 1
    The "didn't match anything" part might be due to the OP using Vim, which has a different regex syntax. Clarifying that in the question would be useful as well.
    – duplode
    May 8 at 5:11
  • 1
    Ah right, the correct vi syntax would be <\{1\}.*>\{1\}; but of course, all the more reason to skip the redundant {1}s.
    – tripleee
    May 8 at 5:14
  • 1
    I suspect that OP intended {1} not as a quantifier, but as some kind of placeholder/backreference mechanism (i.e. "match anything in these two places, as long as it's the same thing both times"). May 8 at 5:50
  • 3
    There was another speculation in a comment on the original question that they mean "exactly once, not more" but, well, only more proof that code which doesn't do what you want is not a good way to explain what it is that you actually want.
    – tripleee
    May 8 at 5:53
  • So the conclusion is that, even if it was beaten in shape, it would still be closed as a duplicate(?). May 8 at 12:21
  • Well, it's not clear enough to say for certain; but if the question is "how can I use {1} in vim the answer is \{1\} and if the question is "how can I match the same string repeated with stuff between the occurrences" that's a common FAQ; and if it's "why does {1} not restrict how many matches there can be" that's a possibly slightly novel twist on an extremely common beginner FAQ so perhaps or perhaps not a duplicate.
    – tripleee
    May 8 at 12:23

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