Not quite accurate.
^ is the beginning of the string, not the first occurrence.
$ is the end of the string, not the last occurrence.
^. will work only if . is the first character (as you mention).
Here are the inputs that will do the work with pub.string:replace
inString: the.quick.brown.fox
searchString: .(.*)
replaceString: #$1
useRegex: true
The output will be the#quick.brown.fox
I’m not sure how efficient that will be for a lengthy string but it does the job.
Of course you create your own Java service as suggested, but at least there is an option to leverage what already exists.
#webMethods#Flow-and-Java-services#Integration-Server-and-ESB