Skip to content

fe-useful-tools/useful-regexp

USEFUL-REGEXP

license releases GitHub package.json version downloads pkg dependents 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);

🚀 Download

Download the latest version of useful-regexp at https://github.com/fe-useful-tools/useful-regexp/releases

About

Useful regex patterns and functions for easier programming.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published