New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rut-regex

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rut-regex

Regular expression for matching Chile RUTs

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
39
increased by69.57%
Maintainers
1
Weekly downloads
 
Created
Source

rut-regex

Build Status XO code style

Regular expression for matching Chile RUT's

Install

$ npm install --save rut-regex

Usage

const rutRegex = require('rut-regex')

rutRegex().test('Felipito 8.714.763-0')
// true

rutRegex().test('8.714.763-0 Felipito')
// true

rutRegex({exact: true}).test('Felipito 8.714.763-0')
// false

rutRegex({exact: true}).test('8.714.763-0')
// true

rutRegex({exact: true, dot: false}).test('8714763-0')
// true

rutRegex({exact: true, dot: false, hyphen: false}).test('87147630')
// true

'Ganadores 8.714.763-0 18.972.631-7 :tada:'.match(rutRegex())
// [ '8.714.763-0', '18.972.631-7' ]

API

rutRegex(options)

Returns a regex for matching Chile RUT's.

options

Type: Object

exact

Type: boolean
Default: false

Only match an exact string. Useful with RegExp#test to check if a string is a RUT.

dot

Type: boolean
Default: true

Dot (.) in RUT.

hyphen

Type: boolean
Default: true

Hyphen (-) in RUT.

  • rut.js - Sencilla y pequeña librería para validar y dar formato al RUT

License

MIT © Jesus Lobos

Keywords

FAQs

Package last updated on 08 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc