哪个 JavaScript RegExp 可以查找任何替代文本?
htmljavascriptprogramming scripts更新于 2024/5/31 5:32:17
要匹配任何指定的替代文本,请遵循下面给出的模式 −
(foo|bar|baz)
示例
您可以尝试运行以下代码来查找任何替代文本 −
<html> <head> <title>JavaScript Regular Expression</title> </head> <body> <script> var myStr = "one,one,one, two, three, four, four"; var reg = /(one|two|three)/g; var match = myStr.match(reg); document.write(match); </script> </body> </html>
相关文章
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

