how to fix jslint message Insecure '.'

前端 未结 3 1958
借酒劲吻你
借酒劲吻你 2021-01-04 06:11

jslint reports message Insecure \'.\'.

at line

html = /([\\s\\S]*)<\\/body>/.exec(responseText);

How to fix th

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-04 06:52

    You may try something like this if you really want it to match everything and don't want the jslint error.

    var everything = /.*?/;// not jslint acceptable
    var all = /[\w\W]*?/;// jslint acceptable
    

    basically it says any word character and any non-word character... which pretty much covers everything.

提交回复
热议问题