With JavaScript RegExp find a character except newline?

HTMLJavascriptProgramming Scripts

To find a character except for a newline, use the Metacharacter. (period). You can try to run the following code to find a character −

Example

<html>
   <head>
      <title>JavaScript Regular Expression</title>
   </head>
   <body>
      <script>
         var myStr = "We provide websites! We provide content!";
         var reg = /p.o/g;
         var match = myStr.match(reg);
         
         document.write(match);
      </script>
   </body>
</html>
raja
Published on 26-Feb-2018 10:56:33
Advertisements