Open shuobeige11 opened 5 years ago
/([a-zA-Z:][-a-zA-Z0-9:.])(?:\s=\s(?:(?:"((?:\.|[^"]))")|(?:'((?:\.|[^']))')|([^>\s]+)))?/g parse里这段正则需要改下 /([a-zA-Z:][-a-zA-Z0-9:.])(?:\s=\s((?:(?:"((?:\.|[^"]))")|(?:'((?:\.|[^']))')|([^>\s]+))))?/g
其实是没错的,正则里面双引号放在前面,所以第三个参数是值。如果用单引号,应该是第四个才是值。
/([a-zA-Z:][-a-zA-Z0-9:.])(?:\s=\s(?:(?:"((?:\.|[^"]))")|(?:'((?:\.|[^']))')|([^>\s]+)))?/g parse里这段正则需要改下 /([a-zA-Z:][-a-zA-Z0-9:.])(?:\s=\s((?:(?:"((?:\.|[^"]))")|(?:'((?:\.|[^']))')|([^>\s]+))))?/g