0.4.0 • Published 3 years ago

regex-go v0.4.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Regex Go

Regex Go is a convenient package that provides some common regular expressions.

Usage

Install this package:

npm install regex-go --save

Use the APIs you need in your program, e.g.:

import { isDomain } from 'regex-go';

if (isDomain('google.com')) {
  console.log('This is a domain!');
}

If you want to use ESModule version, you should need to import this package from regex-go/esm, the default one is es moudle.

API Reference

Domain

isDomain(s: string): boolean

If the string is a domain.

Email

isEmail(s: string): boolean

If the string is an email address.

String

containsEmoji(s: string): boolean Test if the string contains emoji. (the pattern comes from emoji-regex)

containsChinese(s: string): boolean Test if the string contains Chinese characters.

Build

Just install the dependencies and run npm run build.

License

MIT

0.3.0

3 years ago

0.2.0

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago