Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rgb-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

rgb-regex

Regex for RGB color strings.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.7M
decreased by-6.3%
Maintainers
1
Weekly downloads
 
Created

What is rgb-regex?

The rgb-regex package provides a regular expression for matching RGB color strings in text. It can be used to find and manipulate RGB color strings within strings of text in JavaScript applications.

What are rgb-regex's main functionalities?

Matching RGB strings

This feature allows you to match RGB color strings in a given text. The code sample demonstrates how to use the rgb-regex package to find an RGB string within a larger string.

const rgbRegex = require('rgb-regex');
const text = 'background: rgb(12, 34, 56);';
const match = text.match(rgbRegex());
console.log(match[0]); // 'rgb(12, 34, 56)'

Matching RGB strings with exact option

This feature allows you to match an exact RGB string without any additional characters. The code sample shows how to use the rgb-regex package to test for an exact RGB string match.

const rgbRegex = require('rgb-regex');
const exactMatch = 'rgb(12, 34, 56)';
const isExactMatch = rgbRegex({ exact: true }).test(exactMatch);
console.log(isExactMatch); // true

Other packages similar to rgb-regex

Keywords

FAQs

Package last updated on 02 Feb 2015

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