<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <script> var reg = /((.+?))/g; var reg2 = /((.+?))/; var str = 'scale(1.5) rotate(20deg) translate(20px)'; var result = str.match(reg); result.forEach(function(i){ var result2 = i.match(reg2); // console.log(result2[0]); console.log(result2[1]); }) </script> </body> </html>