运行 ❯
获取您的
自己的
网站
×
更改方向
保存代码
更改主题,暗色/亮色
前往 Spaces
<!DOCTYPE html> <html> <body> <h2>JavaScript RegExp</h2> <p>The exec() method tests for a match in a string:</p> <p>Search a string for the character "e":</p> <p id="demo"></p> <script> let text = "The best things in life are free"; let result = /e/.exec(text); document.getElementById("demo").innerHTML = result; </script> </body> </html>