snowflake-regex
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Snowflake

Snowflake Regex

Generates a regex for Discord Snowflakes, its pretty simple

Usage

const snowflakeRegex = require("snowflake-regex"); // For ES6/TS use import snowflakeRegex, { generate } from 'snowflake-regex'
snowflakeRegex.default.test("296776625432035328"); // true
snowflakeRegex.default.test("balls 296776625432035328"); // false

const customSnowflakeRegex = snowflakeRegex.generate({
  exact: false,
  global: true,
  multiline: true
});

customSnowflakeRegex.test("balls 296776625432035328"); // true
"balls 296776625432035328".match(customSnowflakeRegex); // [ '296776625432035328' ]
"balls 296776625432035328".match(snowflakeRegex.default); // null

Package Sidebar

Install

npm i snowflake-regex

Weekly Downloads

11

Version

1.0.4

License

ISC

Unpacked Size

3.57 kB

Total Files

5

Last publish

Collaborators

  • commandtechno