js正则匹配以某字符串开始字符串时间:2023-03-08 18:56:28let decode_sql ="select * from table where create_user='user' order by id desc"; decode_sql.match(/^SELECT.*/gi) decode_sql.match(/^INSERT.*/gi) 以某个字符串开始 是用正则的 ^ 中间的所以字符 可以用 .* . 表示任意字符 * 表示0次到多次匹配 i 表示忽略大小写