# scoped-regex

> Regular expression for matching scoped npm package names

Latest version **3.0.0** (published 2021-04-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install scoped-regex
pnpm add scoped-regex
yarn add scoped-regex
bun add scoped-regex
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-04-17 |
| First published | 2017-03-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 28 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | scoped, npm, package, name, regex, regexp, regular, expression |

## Links

- npm: https://www.npmjs.com/package/scoped-regex
- Repository: https://github.com/sindresorhus/scoped-regex
- Homepage: https://github.com/sindresorhus/scoped-regex#readme
- Issues: https://github.com/sindresorhus/scoped-regex/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/scoped-regex

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 3.0.0 (latest) — 2021-04-17
- 2.1.0 — 2019-04-04
- 2.0.0 — 2019-03-11
- 1.0.0 — 2017-03-22

## README

# scoped-regex

> Regular expression for matching [scoped npm package names](https://docs.npmjs.com/misc/scope)

## Install

```
$ npm install scoped-regex
```

## Usage

```js
import scopedRegex from 'scoped-regex';

scopedRegex({exact: true}).test('@sindresorhus/df');
//=> true

'foo @sindresorhus/df bar'.match(scopedRegex());
//=> ['@sindresorhus/df']
```

## API

### scopedRegex(options?)

Returns a `RegExp` for matching scoped package names.

#### options

Type: `object`

##### exact

Type: `boolean`\
Default: `false` *(Matches any scoped package names in a string)*

Only match an exact string. Useful with `RegExp#test()` to check if a string is a scoped package name.

## Related

- [is-scoped](https://github.com/sindresorhus/is-scoped) - Check if a string is a scoped npm package name

---
_Source: https://npm.io/package/scoped-regex · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
