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/