码迷,mamicode.com
首页 > 其他好文 > 详细

正则匹配括号中内容

时间:2017-04-24 12:17:04      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:reg   ota   span   tran   console   括号   document   tle   pre   

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

技术分享

正则匹配括号中内容

标签:reg   ota   span   tran   console   括号   document   tle   pre   

原文地址:http://www.cnblogs.com/yesyes/p/6755368.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!