JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q47844F
  • License MIT

regexits will perform curated regex on a strings

Package Exports

  • regexits

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (regexits) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status tippin.me Donate.Paypal Donate.Coffee Donate.Patreon

Regexits a light weight regex npm package for common used regex match, string manipulation.


To install

npm install regexits

To Use

const regexits = require('regexits')

// To find if a string matches a pattern.
regexits.match(string, pattern);

// To remove a certain type from a string.
regexits.removeFromString(string, pattern);

// To get parameters from url.
regexits.getURLParameters(url);

Quick Example

const regexits = require('regexits')

regexit.match('012-34-5678', 'SSN')

returns true

const strippedString = regexits.removeFromString('REGE5634324XITS IS52353 GREA55454T' , 'REMOVENUMBERS');

returns 'REGEXITS IS GREAT'

const parameter = regexits.getURLParameters('http://url.com/page?name=Adam&surname=Smith');

returns {name: 'Adam',surname: 'Smith',}

Patterns for matching that are current available

  • DateSlashes , Time24hr , Date
  • ISO8601DT , HTMLtag , HEXColor
  • URLSlug , SrcImgTag , URL
  • Email, Password , PosInt
  • NegInt, Integer , PosNum
  • NegNum, Num ,PhoneNum
  • NewLine , CSSComment , USCAZip
  • SSN , EMAIL, IPV4
  • IPV6 , IPV4ORV6 , VISA
  • MASTERCARD , AMEX ,DINERS
  • DISCOVER, JCB , POBOX
  • SHA256 , MD5 , MAINNET
  • TESTNET , GITHUB

To remove from string

  • SPECIALCHARS
  • ALLWHITESPACE
  • TRIMEND
  • TRIMBEGIN
  • REMOVENUMBERS
  • LEAVENUMBERS

Reporting issue / Feature (new pattern)

To report issue please use the issue template in the repo to follow.

To Contribute

To contribute please create a pull request