Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to 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>