Skip to content

Conversation

Mottie
Copy link
Collaborator

@Mottie Mottie commented Jul 1, 2018

Restored previous behavior:

const ipRegex = require('ip-regex');

// Contains an IP address?
ipRegex().test('192.168.0.2000000000');
//=> true

// Matches an IP address
'192.168.0.2000000000'.match(ipRegex());
//=> '192.168.0.200'

Added includeBoundaries option:

const ipRegex = require('ip-regex');

// Contains an IP address?
ipRegex({includeBoundaries: true}).test('192.168.0.2000000000');
//=> false

// Matches an IP address?
'192.168.0.2000000000'.match(ipRegex({includeBoundaries: true}));
//=> null

@Mottie Mottie requested a review from sindresorhus July 11, 2018 13:40
@sindresorhus sindresorhus merged commit e93d528 into master Jan 18, 2019
@sindresorhus sindresorhus deleted the boundaries branch January 18, 2019 06:50
@sindresorhus
Copy link
Owner

Sorry about the long delay. This one got lost in my tabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants