vamtiger-regex-period

A Regular Expression to Match a Period Character.

Usage no npm install needed!

<script type="module">
  import vamtigerRegexPeriod from 'https://cdn.skypack.dev/vamtiger-regex-period';
</script>

README

VAMTIGER Regex Period

A regular expression to match a period character(s) for a defined input string.

Installation

VAMTIGER Regex Period can be installed using npm or yarn:

npm i --save vamtiger-regex-period

or

yarn add vamtiger-regex-period

Usage

Import or require a referece to VAMTIGER Regex Period:

/// <reference path="../node_modules/vamtiger-regex-period/build/index.d.ts"/>
import { regex } from 'vamtiger-regex-period';

or

const { regex } = require('vamtiger-regex-period');

VAMTIGER Regex Period can then be used to match a period:

const string = 'perion in then . middle';
const match = string.match(regex);


/**
 * if (match) {
 *     // Yep, the input string contains a period
 * }
 **/

Other regular expressions include:

  • globalRegex
  • multilineRegex
  • globalMultilineRegex
import { regex, globalRegex, multilineRegex, globalMultilineRegex } from 'vamtiger-regex-period';

const string = '1.2.3';
const multiLineString = `
    1.2
    3.4
`;

string.split(regex); // [ '1', '2', '3' ]
string.replace(regex, '*'); // '1*2.3'
string.replace(globalRegex, '*'); // '1*2*3'
multiLineString.replace(multilineRegex, '*'); // '\n    1*2\n    3.4\n'
multiLineString.replace(globalMultilineRegex, '*'); // '\n    1*2\n    3*4\n'