UNPKG

974 BMarkdownView Raw
1# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
2
3> Regular expression for matching HTML comments
4
5
6## Install
7
8```sh
9$ npm install --save html-comment-regex
10```
11
12
13## Usage
14
15```js
16var htmlCommentRegex = require('html-comment-regex');
17
18htmlCommentRegex.test('<!DOCTYPE html><!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--><html lang="en"><head><meta charset="UTF-8"><title>Document</title></head><body></body></html>');
19//=> true
20
21htmlCommentRegex.test('<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Document</title></head><body></body></html>');
22//=> false
23```
24
25
26## License
27
28MIT © [Steve Mao](https://github.com/stevemao)
29
30
31[npm-image]: https://badge.fury.io/js/html-comment-regex.svg
32[npm-url]: https://npmjs.org/package/html-comment-regex
33[travis-image]: https://travis-ci.org/stevemao/html-comment-regex.svg?branch=master
34[travis-url]: https://travis-ci.org/stevemao/html-comment-regex