DEV Community

Sa
Sa

Posted on

ChatGPT - is it strong and should you be wary of it?

I won't list the concerns that the chatGPT has raised among the average Internet user - there are tons of them, you can read for yourself.
But here I gave him an assignment: "Can you suggest a regular expression in PHP that would remove all attributes of all tags except src in the text?"...
After each answer he gave, the standard task clarification began:

  • only the SRC attribute should be left, the rest should be removed
  • the content of the SRC attribute should remain as well
  • this code doesn't work, check yourself
  • in this version the code does not work, because all attributes except style|class|alt remain

And so on.

After playing with it for about 10 minutes, I quickly found a solution here https://stackoverflow.com/questions/33093509/php-regex-remove-all-attibute-except-href-in-html and it is very correct at least from the position that it allows you to easily replace href with src, add a couple of attributes - that is, it gives a flexible, customizable solution. Chat could not give me such a result.

Hence two conclusions:

  1. At this stage, it is not worth being afraid of it - the revolution of cars is still postponed :)
  2. To use it, you need to be able to do what you are asking it to help you with!

And the second conclusion makes you wonder: what is the purpose of a chatGPT? The answer is simple - as a generator of ideas and directions for finding an answer! This is where it is great, as it gives us a squeeze of the entire Internet, saving us hours of searching and processing garbage!

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay