1.0.1 • Published 5 years ago

regex-collection v1.0.1

Weekly downloads
18
License
MIT
Repository
github
Last release
5 years ago

Useful regex patterns and functions to test them.

Currently using 268 tests for 9 functions to ensure accurate results!

:white_check_mark: Supported patterns for:

  • CSS comments
  • Email addresses
  • Full numbers / Integer
  • Full numbers / Integer (Negative)
  • Full numbers / Integer (Positive)
  • Hex color codes
  • IP addresses
  • Telephone numbers

Documentation :clipboard:


:package: Install

npm i regex-collection

:clipboard: Usage

Importing

JavaScript

const search = require('regex-collection')

TypeScript

import * as search from 'regex-collection'

Syntax

The syntax is the same for JavaScript and TypeScript

get Get all occurrences of regex

const text = "Hello World contact@example.com Bye World hello@world.com"

let result = search.getEmailAddress(text)
// => ["contact@example.com", "hello@world.com"]

is Check if a string matches to a regex

const text = "Hello World contact@example.com Bye World hello@world.com"

let result = search.isEmailAddress(text)
// => false
const text = "contact@example.com"

let result = search.isEmailAddress(text)
// => true
1.0.1

5 years ago

1.0.0

5 years ago

1.0.0-1

5 years ago

1.0.0-0

5 years ago

0.7.0

5 years ago

0.6.0

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago