Computer >> Computer tutorials >  >> Programming >> Javascript

Find a form feed character with JavaScript RegExp.


To find a form feed character with JavaScript Regular Expression, use the following −

\f

Example

You can try to run the following code to find a form feed character. It returns the position where the form feed (\f) character is found −

<html>
   <head>
      <title>JavaScript Regular Expression</title>
   </head>
   <body>
      <script>
         var myStr = "100% \f Responsive!";
         var reg = /\f/;
         var match = myStr.search(reg);
         
         document.write(match);
      </script>
   </body>
</html>