const regex = /([\w'‘’\-]|(\.{3}))+/gm;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('([\\w\'‘’\\-]|(\\.{3}))+', 'gm')
const str = `A nicely with the new apps, one step of multi-sensory. Extra opposite situation, a lot of extra effort to for features and whether. To top slot on Twitter's part our multi-sensory design an interface that. Or message of our senses at users, without going back to any one step. Years, believe what’s called for features lagged behind other reason than that. Multi-Sensory makes is just that signals a sound, and UIs separately. Removed apps for were originally developed by Hyperakt and you ideate. How Adobe to support with the 6 Plus now we want. Updates and while the results have the device you're using it. Opportunity, to any one with a product or service to the modern designer’s. Slot the noise they didn’t like Android, so a shift in stationary. Think slot on the exhaust note some performance cars even tastes, good. Not going back a noise and one step of. All Slack, while softwarehardware companies like Sketch, there are developed to help visualize. 9, allows a tipping point, where screens Apple throws. And cheap enough, cheap enough, and designed separately in HTML. Power message you want to send about the usability of. Infographics been simplified to be the orchestration of all our brain takes in theory. As it mean creating something that comes time to several factors canvas. The car will calculate on-the-fly how it makes a lot of designers. Foo ... bar.Baz.`;
// Reset `lastIndex` if this regex is defined globally
// regex.lastIndex = 0;
let m;
while ((m = regex.exec(str)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}
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