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

rgba-regex

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rgba-regex

Regex for matching RGBA color strings.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.3M
decreased by-9.46%
Maintainers
1
Weekly downloads
 
Created

What is rgba-regex?

The rgba-regex npm package provides a regular expression for matching RGBA color strings. This can be useful for validating, parsing, or extracting RGBA color values from strings in various applications.

What are rgba-regex's main functionalities?

Match RGBA color strings

This feature allows you to match RGBA color strings within a larger string. The code sample demonstrates how to use the rgba-regex package to find an RGBA color string in a CSS declaration.

const rgbaRegex = require('rgba-regex');
const str = 'background-color: rgba(255, 99, 71, 0.5);';
const match = str.match(rgbaRegex());
console.log(match); // ['rgba(255, 99, 71, 0.5)']

Validate RGBA color strings

This feature allows you to validate whether a given string is a valid RGBA color string. The code sample shows how to use the rgba-regex package to check if a string is a valid RGBA color.

const rgbaRegex = require('rgba-regex');
const isValidRgba = rgbaRegex().test('rgba(255, 99, 71, 0.5)');
console.log(isValidRgba); // true

Other packages similar to rgba-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