const regex = /(\/column\/mania-\b(?!list)(.*))/gm;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('(\\\/column\\\/mania-\\b(?!list)(.*))', 'gm')
const str = `/column/mania-list
/column/mania-001
/column/mania-003
/column/mania-test
/contents/truck-show
/column/makers-007
/column/makers-list
/column/makers-001
/column/makers-test
/column/craftman-list
/column/craftman-008
/column/craftman-001
/column/craftman-asf
/column/jobcolumn-074
/column/jobcolumn-098
/column/jobcolumn-098
/column/jobcolumn-list
/column/job-skill-016
/column/job-skill-test
/column/job-skill-list
/column/job-skill-054
/column/job-skill-016
/column/work-laboratory-list
/column/work-laboratory-039
/column/work-laboratory-test
/column/watashi-yorokobi/sskonomi-suzuki
/column/watashi-yorokobi/eri-tokunaga
/column/watashi-yorokobi
/column/watashi-yorokobi/lully-miura
/column/town-navigation-list
/column/town-navigation-050
/column/town-navigation-lisd
/column/town-navigation-test
/column/cartoon-002
/column/cartoon-001
/column/cartoon-2fe
/column/cartoon-list
/contents/glossary
/column/toyota-seisan-023
/column/toyota-seisan-021
/column/toyota-seisan-020
/column/toyota-seisan-aasdss
/column/toyota-seisan-list`;
// 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