You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

is-posix-bracket

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-posix-bracket

Returns true if the given string is a POSIX bracket expression (POSIX character class).


Version published
Maintainers
1
Created

Package description

What is is-posix-bracket?

The is-posix-bracket npm package is designed to check if a string includes a POSIX bracket expression. POSIX bracket expressions are a special kind of syntax used in regular expressions to define a range or class of characters to match. This package provides a simple utility function to detect these expressions in strings, which can be particularly useful when parsing or processing regular expressions or strings in applications that need to handle text patterns.

What are is-posix-bracket's main functionalities?

Detection of POSIX bracket expressions

This feature allows developers to check if a string contains a POSIX bracket expression. The function returns true if the string is a POSIX bracket expression, otherwise false. This is useful for validating or parsing regular expressions in text processing applications.

const isPosixBracket = require('is-posix-bracket');
console.log(isPosixBracket('[[:alpha:]]')); // true
console.log(isPosixBracket('[a-z]')); // false

Other packages similar to is-posix-bracket

Readme

Source

is-posix-bracket NPM version NPM downloads Build Status

Returns true if the given string is a POSIX bracket expression (POSIX character class).

Install

Install with npm:

$ npm install is-posix-bracket --save

Usage

var isPosixBracket = require('is-posix-bracket');

isPosixBracket('[foo:]]');
//=> false
isPosixBracket('[xdigit:]]');
//=> false
isPosixBracket('[[:xdigit:]]');
//=> true
isPosixBracket('[[:xdigit:]]');
//=> true
isPosixBracket('[[:alpha:]123]');
//=> true
isPosixBracket('[[:alpha:]123]');
//=> true
isPosixBracket('[a-c[:digit:]x-z]');
//=> true
isPosixBracket('[:al:]');
//=> true
isPosixBracket('[abc[:punct:][0-9]');
//=> true

You might also be interested in these projects:

  • braces: Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… more | homepage
  • expand-brackets: Expand POSIX bracket expressions (character classes) in glob patterns. | homepage
  • is-extglob: Returns true if a string has an extglob. | homepage
  • is-glob: Returns true if the given string looks like a glob pattern or an extglob pattern.… more | homepage
  • micromatch: Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… more | homepage

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

Generate readme and API documentation with verb:

$ npm install verb && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v, on April 05, 2016.

Keywords

FAQs

Package last updated on 05 Apr 2016

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc