如何使用 JavaScript RegExp 执行多行匹配?
htmljavascriptprogramming scripts更新于 2024/5/31 6:04:17
要执行多行匹配,请使用 JavaScript 正则表达式中的 M 修饰符。
示例
您可以尝试运行以下代码来执行多行匹配 −
<html> <head> <title>JavaScript Regular Expression</title> </head> <body> <script> var myStr = "Welcom
ing!"; var reg = /^ing/m; var match = myStr.match(reg); document.write(match); </script> </body> </html>
相关文章
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

