With JavaScript RegExp search a carriage return character.

To find carriage return character with JavaScript Regular Expression, use the following −



You can try to run the following code to find a carriage return character. It returns the position where the carriage return (\r) character is found −

      <title>JavaScript Regular Expression</title>

         var myStr = "100% \r Responsive!";
         var reg = /\r/;
         var match = myStr.search(reg);