Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个这样的字符串:
snippet = "Paragraph: <p>The night sky is beautiful!</p> ";
如何仅返回第一个和最后一个空格之间的文本? 因此只返回段落标签:
<p>The night sky is beautiful!</p>
使用这个表达式:
snippet.match(/\s(.*)\s/)
http://jsfiddle.net/zerkms/Qhe8J/1/