Prev Demo
JavaScript
>
Matches String Followed By Particular Character
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to match a string 'ear' followed by 'rings' .</p> <input type="button" onclick="mySearch()" value="Search"> <p id="myId"></p> <script> function mySearch() { var A = "Last year is all were wear rings to their right ear?" var B = /ear(?= rings)/g; var R = A.match(B); document.getElementById("myId").innerHTML = R; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output