怎么匹配List啊,我不会了,请教老师和大家
Welcome to Node.js v12.13.0.
Type ".help" for more information.
> var str="[1 张三 18 2001-01-01, 2 李四 25 1994-01-01]";
undefined
> console.log(str.replace(/[(\d{1})\t(\w{2})\t(\d{1})\t(\w[\d{4}-\d{2}-\d{2}]),]/g,$1$2$3$4));
Thrown:
SyntaxError: Invalid regular expression: /[(\d{1})\t(\w{2})\t(\d{1})\t(\w[\d{4}-\d{2}-\d{2}]),]/: Unmatched ')'
> var str2="[1 张三 18 2001-01-01]";
undefined
> console.log(str.replace(/[(\d{1})\t(\w{2})\t(\d{1})\t(\w[\d{4}-\d{2}-\d{2}])]/g,$1$2$3$4));
Thrown:
SyntaxError: Invalid regular expression: /[(\d{1})\t(\w{2})\t(\d{1})\t(\w[\d{4}-\d{2}-\d{2}])]/: Unmatched ')'
>
怎么匹配List啊,我不会了,请教老师和大家