var str = "QAbcd123%^&90Q";var reg = /^Q(.*)Q$/;str = str.replace(reg,'$1');so result str is 'Abcd123&%^&90'
如果替换固定字符,不用正则表达是啊。直接替换啊。