1.0.1 โข Published 4 years ago
useful-regexp v1.0.1
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.
:wrench: Getting Started
:card_file_box: Documentation
You can find for more details, API on ๐ Documentation.
:package: 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);