http://qs321.pair.com?node_id=11116602


in reply to Re: Why a regex *really* isn't good enough for HTML, even for "simple" tasks
in thread Why a regex *really* isn't good enough for HTML and XML, even for "simple" tasks

Your argument is utterly unconvincing. Noone would claim that parsing that HTML is a simple task.

Except that's not what I said, and people do try to use regexes to extract stuff from HTML all the time.

The real reason not to create a half-assed parser (using regex or otherwise) is the following: "But it worked yesterday." A hacked up solution is going to be far less resilient to change and a lot more expensive to maintain than one using a proper parser.

Which is exactly the argument I made in Parsing HTML/XML with Regular Expressions.

Update: PerlMonks has a preview function; I won't be responding to your ninja edits. The above quotes represent the entirety of your post at my time of posting.

Replies are listed 'Best First'.
Re^3: Why a regex *really* isn't good enough for HTML, even for "simple" tasks
by marto (Cardinal) on May 09, 2020 at 09:05 UTC
Re^3: Why a regex *really* isn't good enough for HTML, even for "simple" tasks
by ikegami (Patriarch) on May 09, 2020 at 09:20 UTC

    people do try to use regexes to extract stuff from HTML all the time.

    I know. And like I said, your argument isn't going to convince a single one of them to stop. They will see their tasks as simple tasks and yours as complex, and you completely failed to show why regex shouldn't be used for simple tasks despite your claims. Perhaps you should add an explanation as to why they shouldn't be used for simple tasks?

      I know. And like I said, your argument isn't going to convince a single one of them to stop. They will see their tasks as simple tasks and yours as complex, and you completely failed to show why regex shouldn't be used for simple tasks despite your claims.

      I see your point now, and I guess that means your initial post could have been something along the lines of "I think your argument might be less effective because people will see their tasks as simple tasks and yours as complex, so how about adding an explanation why regexes still shouldn't be used?". Instead, you chose to be rude.

      Update: Once again, the above quote represents the entirety of your node at the time I saw it and started composing my reply.

      Downvoting and ignoring constructive criticism isn't going to convince the people you are supposedly trying to help. When I say it won't convince them, I mean it has always failed to convince them before. I've seen people have made the same argument countless times to no avail. The best results I've seen have been from showing them it's actually easier to do it right. That even appears to be the message you are trying to send with the examples, so it's really just a question of how you frame the problem!

        Downvoting and ignoring constructive criticism isn't going to convince the people you are supposedly trying to help. When I say it won't convince them, I mean it has always failed to convince them before. I've seen people have made the same argument countless times to no avail. The best results I've seen have been from showing them it's actually easier to do it right.

        First of all, I do take criticism, as I've shown time and time again; saying I've ignored it is quite unfair because you haven't even given me a chance to edit my node because I'm here responding to your barrage of posts and ninja edits. Second, your first few posts here were absolutely not "constructive criticism".

        Update: Despite your series of incredibly rude posts here ("Your argument is utterly unconvincing.", "you completely failed", "the people you are supposedly trying to help", which I would normally ignore as trolling), in this case I have made a small edit to the top of the root node. I can only hope you're aware that your "style" of posting seriously reduces the effectiveness of your communication, and in the future I may very well choose to ignore any "advice" from you that isn't actually constructive. Postel's law applies to the sender as well, you know.

        In addition:

        The best results I've seen have been from showing them it's actually easier to do it right.

        I do, all the freaking time (no, really).

        Sometimes, people will still need further convincing or want to know why their approach won't work, which is why I created the root node in the first place, as something to link to that will very likely break their regexes.

Re^3: Why a regex *really* isn't good enough for HTML, even for "simple" tasks
by ikegami (Patriarch) on May 09, 2020 at 09:03 UTC

    Except that's not what I said

    You said: "Why a regex *really* isn't good enough for HTML, even for "simple" tasks". So yeah, you did.

    Which is exactly the argument I made in Parsing HTML/XML with Regular Expressions.

    ok, but it's what you said here I'm commenting on.

      Noone would claim that parsing that HTML is a simple task.

      Since you're active on both PerlMonks and StackOverflow, you must be aware of the fact that scores of people try to pull stuff from HTML using regexes. My node title is what it is as a response to that.

      You said: "Why a regex *really* isn't good enough for HTML, even for "simple" tasks". So yeah, you did.

      Read the what I wrote again keeping in mind what I said above and maybe you'll see that your interpretation of what I said is not what I meant. Unfortunately, it seems that once again your drive to maintain that you are correct appears to be stronger than your drive to be reasonable, so I'm out.