.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / shebang-regex / readme.md
1 # shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex)
2
3 > Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line
4
5
6 ## Install
7
8 ```
9 $ npm install shebang-regex
10 ```
11
12
13 ## Usage
14
15 ```js
16 const shebangRegex = require('shebang-regex');
17
18 const string = '#!/usr/bin/env node\nconsole.log("unicorns");';
19
20 shebangRegex.test(string);
21 //=> true
22
23 shebangRegex.exec(string)[0];
24 //=> '#!/usr/bin/env node'
25
26 shebangRegex.exec(string)[1];
27 //=> '/usr/bin/env node'
28 ```
29
30
31 ## License
32
33 MIT © [Sindre Sorhus](https://sindresorhus.com)