运行 ❯
获取您
自己
的网站
×
更改方向
保存代码
更改主题,暗/亮
前往 Spaces
<!DOCTYPE html> <html> <body> <h2>JavaScript Regular Expressions</h2> <p>Search a string for "w3Schools", and display the position of the match:</p> <p id="demo"></p> <script> let text = "Visit W3Schools!"; let n = text.search(/w3Schools/i); document.getElementById("demo").innerHTML = n; </script> </body> </html>