I realize this question is old by now, but it still applied to BP 6.3.1.7631:
The expression syntax is valid, except that the function argument separator depends on the system locale. Sometimes you have to use a semicolon and sometimes a comma is needed. In principle it could also be any other character if the locale said so. And complicate things further, this behavior does not always seem to be consistent between different functions in Blue Prism.
But in any case, the present expression is valid if the locale is correct (you can try it out by substituting some constant string in place of the collection reference). For example:
1. Set locale to en-US
2. Try this expression: Replace(""test-string1234""; Left(""test-string1234""; 4); Left(""test-string1234""; 4)&"" "")
3. The result is ""The token ';' is invalid.""
4. Set locale to fi-FI (that's what I use here in Finland)
5. Restart Blue Prism
6. Try the same expression: Replace(""test-string1234""; Left(""test-string1234""; 4); Left(""test-string1234""; 4)&"" "")
7. Now it's valid and you get ""test -string 1234"" a the result