It looks like it is because of the space character that you have after the \b in your regex. There wouldn't be a space before the first word in the sentence.

Try this code:

Code:

var %search = /\b $+ $gettok($read(hs.txt,%i),1,32)\b/g
var %replace = $gettok($read(hs.txt,%i),2-,32)
$regsub(%a,%search,%replace,%a)



-genius_at_work