preg_match_all() 正则匹配js变量答:<?php$str = "var BASE_DATA = {userInfo: {id: 50,userName: 'xxsdfsdfx',avatarUrl: 'xxx',isPgc: true,isOwner: false},headerInfo: {id: 50,isPgc: true,userName: 'xxx',avatarUrl: 'xx',isHomePage: false,chineseTag: 'xxx',crumbTag: 'search/?keyword=%E6%97%B6%E6%94%...