4

The question in particular is extremely localized and has no value to anyone else as a whole.

Match first occurrence of semicolon in string, only if not preceded by '--'

This just makes SO look like the internet's dumping ground of I don't want to read the docs to figure something out and want someone to do my work for me.

We need a Go use RegEx101.com and get this to work or something like that.

This is just a straw man, there are many other questions that exhibit a complete lack of attempt at comprehension. Well written doesn't equal well researched! The java tag is rife with these questions where a simple read the javadoc for comprehension will answer the question, but they want a dissertation on a particular method or class instead of reading themselves.

Regex questions tend to be too localized because they are usually about very specific criteria, if they are about more generally applicable concepts it would not be a problem.

How many people are going to come along and need to not match --; in the future?

Why are we encouraging questions like this?

7
  • 9
    Aren't most regex questions "too localized?" I'm sure this is a dupe...
    – Charles
    Commented Jul 21, 2014 at 15:10
  • How are we "encouraging this" exactly? The upvotes there are understandable IMHO, you don't see a regex question with this amount of detail that often. Commented Jul 21, 2014 at 15:16
  • 4
    @FrédéricHamidi By removing the "Too Localized" close reason, it's not clear such a question should get closed, and usually they aren't anymore
    – Izkata
    Commented Jul 21, 2014 at 15:19
  • Questions like that one are the reason why it's good that "too localized" isn't a close reason any more Commented Jul 21, 2014 at 15:21
  • @Izkata, this may be related to Where did “too localized” go? then. Note we're apparently supposed to use the "can no longer be reproduced" reason instead. Commented Jul 21, 2014 at 15:21
  • Was a debate on meta a few years ago about these regex type questions. Consensus was "they're fun, so let them be." Maybe it's time to reconsider?
    – user1228
    Commented Jul 21, 2014 at 15:38
  • 1
    How is "can't be reproduced/simple typo" a valid reason here?
    – user177800
    Commented Jul 21, 2014 at 15:43

3 Answers 3

5

Well written doesn't equal well researched!

That's true, and lack of research is grounds for downvoting into oblivion. Twice, actually. (they show no research effort, and they are not useful)

So do that.

enter image description here

This particular question, though, has some existing attempts listed, and also is one example of a broader rule:

  • Match a particular character, except if this other string precedes it.

Or even

  • Match this pattern, except if this other pattern matches earlier in the input

I'm sure other people run into that.

-1

TLDR: Yes, we should be encouraging questions like this.


I don't see why that question needs to be closed in the first place. I think that it's a pretty clear question.

It's easy to understand what he's looking for, and it's very clear that he had already made an attempt on his own, and is looking to increase his knowledge rather than just get some work done for free.

Even though he might have a rare need, there's nothing that causes it to be unique to him specifically.

Now he might have been able to phrase his question to be more searchable, but other than that, it's a pretty good question.

1
  • 7
    I personally think these are terrible questions. I'd prefer that they all be closed as duplicates of a general/canonical question on how to use regexes, but that's never gonna happen.
    – Robert Harvey Mod
    Commented Jul 21, 2014 at 17:26
-1

I think it is time for

regex.stackexchange.com

You must log in to answer this question.