{"id":13538370,"url":"https://github.com/micromatch/posix-character-classes","last_synced_at":"2025-07-02T10:06:31.676Z","repository":{"id":55556495,"uuid":"69326715","full_name":"micromatch/posix-character-classes","owner":"micromatch","description":"POSIX character classes for creating regular expressions.","archived":false,"fork":false,"pushed_at":"2020-12-22T08:50:59.000Z","size":12,"stargazers_count":30,"open_issues_count":2,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-12T06:19:19.238Z","etag":null,"topics":["brackets","character-class","digit","expand-brackets","extended-globs","extglob","node","posix","posix-character","regex","regular-expression"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/micromatch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-27T06:34:24.000Z","updated_at":"2025-03-23T13:36:58.000Z","dependencies_parsed_at":"2022-08-15T03:10:32.122Z","dependency_job_id":null,"html_url":"https://github.com/micromatch/posix-character-classes","commit_stats":null,"previous_names":["jonschlinkert/posix-character-classes"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/micromatch/posix-character-classes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromatch%2Fposix-character-classes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromatch%2Fposix-character-classes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromatch%2Fposix-character-classes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromatch%2Fposix-character-classes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micromatch","download_url":"https://codeload.github.com/micromatch/posix-character-classes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micromatch%2Fposix-character-classes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262183423,"owners_count":23271841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brackets","character-class","digit","expand-brackets","extended-globs","extglob","node","posix","posix-character","regex","regular-expression"],"created_at":"2024-08-01T09:01:11.000Z","updated_at":"2025-07-02T10:06:31.615Z","avatar_url":"https://github.com/micromatch.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# posix-character-classes [![NPM version](https://img.shields.io/npm/v/posix-character-classes.svg?style=flat)](https://www.npmjs.com/package/posix-character-classes) [![NPM monthly downloads](https://img.shields.io/npm/dm/posix-character-classes.svg?style=flat)](https://npmjs.org/package/posix-character-classes)  [![NPM total downloads](https://img.shields.io/npm/dt/posix-character-classes.svg?style=flat)](https://npmjs.org/package/posix-character-classes) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/posix-character-classes.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/posix-character-classes)\n\n\u003e POSIX character classes for creating regular expressions.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save posix-character-classes\n```\n\nInstall with [yarn](https://yarnpkg.com):\n\n```sh\n$ yarn add posix-character-classes\n```\n\n## Usage\n\n```js\nvar posix = require('posix-character-classes');\nconsole.log(posix.alpha);\n//=\u003e 'A-Za-z'\n```\n\n## POSIX Character classes\n\nThe POSIX standard supports the following classes or categories of charactersh (note that classes must be defined within brackets)\u003csup class=\"footnote-ref\"\u003e\u003ca href=\"#fn1\" id=\"fnref1\"\u003e[1]\u003c/a\u003e\u003c/sup\u003e:\n\n| **POSIX class** | **Equivalent to** | **Matches** | \n| --- | --- | --- |\n| `[:alnum:]` | `[A-Za-z0-9]` | digits, uppercase and lowercase letters |\n| `[:alpha:]` | `[A-Za-z]` | upper- and lowercase letters |\n| `[:ascii:]` | `[\\x00-\\x7F]` | ASCII characters |\n| `[:blank:]` | `[ \\t]` | space and TAB characters only |\n| `[:cntrl:]` | `[\\x00-\\x1F\\x7F]` | Control characters |\n| `[:digit:]` | `[0-9]` | digits |\n| `[:graph:]` | `[^ [:cntrl:]]` | graphic characters (all characters which have graphic representation) |\n| `[:lower:]` | `[a-z]` | lowercase letters |\n| `[:print:]` | `[[:graph:] ]` | graphic characters and space |\n| `[:punct:]` | ``[-!\"#$%\u0026'()*+,./:;\u003c=\u003e?@[]^_`{\\|}~]`` | all punctuation characters (all graphic characters except letters and digits) |\n| `[:space:]` | `[ \\t\\n\\r\\f\\v]` | all blank (whitespace) characters, including spaces, tabs, new lines, carriage returns, form feeds, and vertical tabs |\n| `[:upper:]` | `[A-Z]` | uppercase letters |\n| `[:word:]` | `[A-Za-z0-9_]` | word characters |\n| `[:xdigit:]` | `[0-9A-Fa-f]` | hexadecimal digits |\n\n## Examples\n\n* `a[[:digit:]]b` matches `a0b`, `a1b`, ..., `a9b`.\n* `a[:digit:]b` is invalid, character classes must be enclosed in brackets\n* `[[:digit:]abc]` matches any digit, as well as `a`, `b`, and `c`.\n* `[abc[:digit:]]` is the same as the previous, matching any digit, as well as `a`, `b`, and `c`\n* `[^ABZ[:lower:]]` matches any character except lowercase letters, `A`, `B`, and `Z`.\n\n## About\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 20, 2017._\n\n\u003chr class=\"footnotes-sep\"\u003e\n\u003csection class=\"footnotes\"\u003e\n\u003col class=\"footnotes-list\"\u003e\n\u003cli id=\"fn1\"  class=\"footnote-item\"\u003etable and examples are based on the WikiBooks page for [Regular Expressions/POSIX Basic Regular Expressions](https://en.wikibooks.org/wiki/Regular_Expressions/POSIX_Basic_Regular_Expressions), which is available under the [Creative Commons Attribution-ShareAlike License](https://creativecommons.org/licenses/by-sa/3.0/). \u003ca href=\"#fnref1\" class=\"footnote-backref\"\u003e↩\u003c/a\u003e\n\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003c/section\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicromatch%2Fposix-character-classes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicromatch%2Fposix-character-classes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicromatch%2Fposix-character-classes/lists"}