1.0.10 • Published 5 years ago

md5-regex v1.0.10

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

md5-regex Build Status XO code style

Regular expression for matching MD5 hashes in strings.

Install

~ ❯❯❯ npm install md5-regex

Usage

const md5Regex = require('md5-regex');

md5Regex().test('nodejsrocks 1abcb33beeb811dca15f0ac3e47b88d9');
//=> true

md5Regex({exact: true}).test('nodejsrocks 1abcb33beeb811dca15f0ac3e47b88d9 foo');
//=> false

md5Regex({exact: true}).test('1abcb33beeb811dca15f0ac3e47b88d9');
//=> true

'nodejsrocks 1abcb33beeb811dca15f0ac3e47b88d9 rainbow 897b47d80a717715378832539b4c1340'.match(md5Regex());
//=> ['1abcb33beeb811dca15f0ac3e47b88d9', '897b47d80a717715378832539b4c1340']

API

md5Regex(options)

Returns a regex for matching MD5 hashes.

options.exact

Type: boolean Default: false (Matches any MD5 hash in a string)

Only match an exact string. Useful with RegExp#test() to check if a string is an MD5 hash.

License

MIT © Nikolaos Kamarinakis

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago