To find characters other than newlines, use metacharacters. (Dot). You can try running the following code to find the characters −
<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>
The above is the detailed content of How to find characters other than newlines using JavaScript's RegExp?. For more information, please follow other related articles on the PHP Chinese website!