vue.js html转义,关于在vue.js中,如何对转义字符进行表达式判断?

18a88f1fe8d91a317546cc7994d00609.png

跃然一笑

123456789101112131415let regex = /^((a|file)\(.+\)|(img|aduio|video))\[.+]$/i; test('should test ok',()=>{    let regex = /^((a|file)\(.+\)|(img|aduio|video))\[.+]$/i;    expect(regex.test('file(a)[b]')).toBe(true);    expect(regex.test('file[b]')).toBe(false);    expect(regex.test('file(b)')).toBe(false);    expect(regex.test('a(a)[b]')).toBe(true);    expect(regex.test('img[c]')).toBe(true);    expect(regex.test('aduio[e]')).toBe(true);    expect(regex.test('video[e]')).toBe(true);    expect(regex.test('video(d)[e]')).toBe(false);    expect(regex.test('aduio(d)[e]')).toBe(false);    expect(regex.test('img(d)[e]')).toBe(false);})