Regular expression for matching HTML empty conditional comments
npm install regex-empty-conditional-commentsRegular expression for matching HTML empty conditional comments
This package is pure ESM. If you're not ready yet, install an older version of this program, 1.11.0 (npm i regex-empty-conditional-comments@1.11.0).
``bash`
npm i regex-empty-conditional-comments
`js
import { strict as assert } from "assert";
import { emptyCondCommentRegex } from "regex-empty-conditional-comments";
// empty comment which was meant to target Outlook-only
assert.equal(
emptyCondCommentRegex().test(),
true,
);
// empty comment which was meant to target non-Outlook-only
assert.equal(
emptyCondCommentRegex().test(),
true,
);
assert.equal(
emptyCondCommentRegex().test(),
false,
);
assert.equal(
emptyCondCommentRegex().test(),
false,
);
assert.equal(
emptyCondCommentRegex().exec("
assert.deepEqual(
.match(emptyCondCommentRegex()),
[""],
);
``Please visit codsen.com for a full description of the API. If you’re looking for the Changelog, it’s here.
To report bugs or request features or assistance, raise an issue on GitHub.
MIT License
Copyright © 2010-2025 Roy Revelt and other contributors
![]()