是( s{2,} /)和(/ s{2 & # 39; & # 39;} /)是一样的吗?如果不是,请解释其中的区别

Are (/s{2,}/) and (/s{2,''}/) the same? If not then please explain the difference

本文关键字:解释 区别 如果不 一样      更新时间:2023-09-26

我只是想知道(/'s{2,}/)(/'s{2,''}/)正则表达式之间的区别?

请举例说明

's{2,}'s{2,''}相同吗?

不,两者不同。

  • 's{2,} ->两个或多个空格。
  • 's{2,''} ->匹配空白字符['r'n't'f]和文字{2,''}