要尋找非空白字符,請使用以下程式碼−
\S
You can try to run the following code to find non-whitespace character −
<html> <head> <title>JavaScript Regular Expression</title> </head> <body> <script> var myStr = "100% Responsive!"; var reg = /\S/g; var match = myStr.match(reg); document.write(match); </script> </body> </html>
以上是使用JavaScript正規表示式尋找非空格字符的詳細內容。更多資訊請關注PHP中文網其他相關文章!