const regex = /(Â|â|Ã|\||©|®|™)/gm;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('(Â|â|Ã|\\||©|®|™)', 'gm')
const str = `Calcaneal Locking Plate â
Aspen Richard-Allan® Surgical Needle, Keith’s Abdominal Cutting, Straight 0.03 in x 2.244 in
Laborie T-DOC® Single Sensor Coudé Catheter, Coude Tip 7 Fr
Hydrocellular Foam Dressings SILICONE ADHESIVE | WITH BORDER | Sacral | GENTLE ADHESIVE | STERILE 7" x 7" Dressing 5" x 5" Pad
00612479126886 c1c1a9c5-39a6-4816-8577-256b35dd2908 New Published 1 2018-11-05 2018-10-05 NULL In Commercial Distribution McKesson 16-4063 NULL 023904428 MCKESSON MEDICAL-SURGICAL INC. 96 Gauze Bandage Roll NON-STERILE 6-PLY | 100% COTTON 3.4" x 3.6 Yards false true false false false true true false false false false false true Labeling does not contain MRI Safety Information false false false false FULLDownload_Part95_Of_100_2020-04-01.xml 2020-04-01 Full GUDID load 2020-04-01T04:19:25 2020-04-03 12:46:39.6105233 9999-12-31 23:59:59.9999999`;
// 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