1.0.9 • Published 7 years ago

rhaegar v1.0.9

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

rhaegar

Build Status NPM version styled with prettier

A lightweight, zero dependency javascript library for dealing with regular expressions.

Installation:

$ yarn add rhaegar
$ npm install rhaegar --save

Usage:

import Rhaegar from 'rhaegar';

const testEmail = new Rhaeger({ pattern: 'email', method: 'test' });

testEmail('ned@winterfell.com');
// => true

testEmail('greyworm@yahoo');
// => false

const matchEmail = new Rhaegar({ pattern: 'email', method: 'match' });

const matched = matchEmail('faceless_woman@bravos.si');
// matched => [ 'faceless_woman@bravos.s', index: 0, input: 'faceless_woman@bravos.si' ]
// matched[0] => 'faceless_woman@bravos.s';
// matched.index => 0
// matched.input => 'faceless_woman@bravos.si';

const testDateTime = new Rhaegar({ pattern: 'dateTime' });

testDateTime('30-11-2003 8:45');
// => true

testDateTime('11-2003 8:45');
// => false

Supported Patterns:

  • email
  • dateTime
  • notBinary
  • alphaNumeric
  • alpha
  • numeric

Supported Methods:

  • test (default)
  • match
1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago