要查找除換行符以外的字符,請(qǐng)使用元字符。 (句點(diǎn))。 您可以嘗試運(yùn)行以下代碼來(lái)查找字符?
示例
<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>
登錄后復(fù)制
以上就是如何使用JavaScript的RegExp查找除換行符以外的字符?的詳細(xì)內(nèi)容,更多請(qǐng)關(guān)注www.92cms.cn其它相關(guān)文章!