JSFiddle - React, Tailwind, and code Playground

JavaScript

var regExp = /opacity\(([^)]+)\)/;
var matches = regExp.exec("opacity(0.46) grayscale(0.7)");

console.log(matches[1]);