正则表达式

  1. 正则表达式 (全局) 与 迭代的 配合:
            var text = 'console.log(person.name);';
            var regex = /(w*sow*)/g;
            var matches ;
            var result = [];
            
            while ( matches = regex.exec( text ) ){// 当matches为null时 表示没有找到符合正则的数据 , 退出循环
                  result.push( matches[1] );
            }
 
 
// TODO  待完成 
原文地址:https://www.cnblogs.com/lmxxlm-123/p/11131887.html