简单教程
提交运行
代码编辑器:
<script> var str="Hi,I'am Ys\n which is the Yes's shortcut"; var patt1=/\n/; document.write(str.search(patt1)); </script>
运行结果: