ChatGPT to learn and create regex expressions

I’ve just tested ChatGPT to create a regex expression and it worked!

I asked ChatGPT: Whats the regex to match a string without the string hello?

And the answer was:

^(?!.*hello).*$

with a helpful explanation:

Screenshot of a ChatGPT response explaining a regular expression to match a string without the word 'hello'. Includes a breakdown of the regex components.

Always take the answers from ChatGPT with a grain of salt, because they can be plain wrong, but I believe this tool can be a real helper to create regular expressions or AutoHotkey macros.



Generated Image Alt-Text
[edited by: RWS Community AI at 3:44 AM (GMT 0) on 15 Nov 2024]
emoji