fixed error in regexpr for removing require.js script on build