I have a string that can be "Hello World!" or "Hello John Doe!" or "Hello user2345!".
I need to validate that said string is one of the above and not "Hello !". i.e. some character has to exist before the exclamation(!) mark.
How do I validate this with regex please?
>Solution :
You could match on:
\bHello(?: \w+)+!
which would match Hello followed by at least one following word, ending in !.