No. it does not. The replacement
has to be a string. Another important difference is that even though searchPattern
is a string, it will create a regexp to do the matching. It's not like String.replace
where you can provide a literal string or a regexp.
You could write your own replaceText
function that uses String.replace "internally". You'd just have to loop the entire document structure looking for Text blocks and do it.