useful-regexp
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

USEFUL-REGEXP

NPM CodeFactor Grade Travis (.org) GitHub package.json version npm npm bundle size

useful-regexp

Useful regex patterns and functions for easier programming.

The repository is a derivative library of the following projects, designed to provide an API out of the box.

ChinaMobilePhoneNumberRegex

any-rule

🔧 Getting Started

🗃️ Documentation

You can find for more details, API on 📚 Documentation.

📦 Install

useful-regexp was designed to work both in the browser and in Node.js.

Node.js

To get started with useful-regexp in your Node.js project, simply add the dependency with NPM.

$ npm install useful-regexp --save

Then include it in your script:

const regexp = require('useful-regexp');
// import * as regexp from 'useful-regexp' // ES 2015
console.log(regexp.isEmail('muikinghk@yahoo.com.hk'));

Browser

<script src="lib/useful-regexp/index.min.js"></script>
<script>
  usefulRegexp.isTel('0341-86091234');
</script>

Typescript

useful-regexp ships with official type declarations for TypeScript in NPM package out of the box.

$ yarn add useful-regexp
# or
$ npm install --save useful-regexp

Import and use in your Typescript file

import { isChineseName } from 'useful-regexp';

const name = '喜塔腊·尔晴';

const isChinese = isChineseName(name);

Readme

Keywords

Package Sidebar

Install

npm i useful-regexp

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

159 kB

Total Files

15

Last publish

Collaborators

  • kingmui