To find carriage returns using JavaScript regular expressions, use the following code -
\r
You can try running the following code to find the carriage return character. It returns the position where the carriage return (\r) character is found -
<html> <head> <title>JavaScript Regular Expression</title> </head> <body> <script> var myStr = "100% \r Responsive!"; var reg = /\r/; var match = myStr.search(reg); document.write(match); </script> </body> </html>
The above is the detailed content of Search for carriage return symbols using regular expressions in JavaScript. For more information, please follow other related articles on the PHP Chinese website!