In the string
somethingcryptic12A@#$~` abc def@#
, I would like to replace the first word by new so that it would then be new
new abc def@#
. How can I do this using regular expression. I have made the first word cryptic to indicate that it can contain any character and any number of characters. It's the first word if there is a space after it.