D:\jspsh>jspsh.exe
js> "A AA AAA".replace(/(^|[^A])A([^A]|$)/g, "$1AA$2")
AA AA AAA
js> :q
Leaving "JScript Power Shell"