Will this do?
var rgbRegex = /^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/
More Related Contents:
- Javascript Regular Expression for rgb values
- Find list of strings that matches a pattern that start with a special character « and end with a special character »
- Need Pattern for password field?
- Javascript Regex for decimal [duplicate]
- Regex to get string between curly braces
- Detect URLs in text with JavaScript
- Regular Expression to get a string between parentheses in Javascript
- What is the meaning of the ‘g’ flag in regular expressions?
- What is the difference between RegExp’s exec() function and String’s match() function?
- Is there a version of JavaScript’s String.indexOf() that allows for regular expressions?
- split string only on first instance of specified character
- Remove HTML Tags in Javascript with Regex
- javascript regex split produces too many items
- Create RegExps on the fly using string variables
- Regular expression for URL validation (in JavaScript)
- How to replace last occurrence of characters in a string using javascript
- Validating user’s UTF-8 name in Javascript
- Javascript fuzzy search that makes sense
- Why doesn’t this Javascript RGB to HSL code work?
- Javascript regular expression to validate URL
- Regex to extract substring, returning 2 results for some reason
- Split a string by whitespace, keeping quoted segments, allowing escaped quotes
- Extract all email addresses from bulk text using jquery
- Regex to split camel case
- JavaScript remove ZERO WIDTH SPACE (unicode 8203) from string
- RegEx Ignore Case
- Javascript – regex – word boundary (\b) issue
- Regex that matches anything except for all whitespace
- How to properly escape characters in regexp
- How to loop all the elements that match the regex?