Tests if argument is valid IP address and return boolean
Basic usage example:
import {ip} from 'stringman'; // or const ip = require('stringman').ip;
const valid = ip.isValid('192.168.0.1');
const invalid = ip.isValid('192.168.0.256');
console.log(valid); // true
console.log(invalid); // false
Takes a string and returns the string with all valid IP addresses removed
Basic usage example:
import {ip} from 'stringman'; // or const ip = require('stringman').ip;
const removed = ip.remove('my router is at 192.168.0.1');
console.log(removed); // 'my router is at'
Gets any and all valid IP addresses from a string and returns in array
Basic usage example:
import {ip} from 'stringman'; // or const ip = require('stringman').ip;
const ips = ip.retrieve('my router is at 192.168.0.1');
console.log(ips); // ['192.168.0.1'];
Takes a string with an IP and another string and returns the first string with all IP addresses swapped with the second string
Basic usage example:
import {ip} from 'stringman'; // or const ip = require('stringman').ip;
const swapped = ip.swap('my router is at 192.168.0.1', '***.***.***.***');
console.log(swapped); // 'my router is at ***.***.***.***'
Generated using TypeDoc
Returns regular expression used to find and verify IP addresses
Basic usage example: