const regex = /\.\s+(Nature and purpose of financial analysis|Users and decision making)\s+(?:An|We)/g;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('\\.\\s+(Nature and purpose of financial analysis|Users and decision making)\\s+(?:An|We)', 'g')
const str = `"As discussed in chapter 1, the users of financial statements can be categorised as resource provider. Users and decision making An example for this. Nature and purpose of financial analysis We have identi fied that financial analysis mvolves expressing reported numbers in financial statements in relative terms. "`;
const subst = `\n`;
// The substituted value will be contained in the result variable
const result = str.replace(regex, subst);
console.log('Substitution result: ', result);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions