nhoizey’s avatarnhoizey’s Twitter Archive—№ 103,111

  1. What’s the best (simple to read, efficient) JavaScript regex to get the first paragraph of an HTML string? I have this one: /<p>((?!(<\/p>)).|\n)+<\/p>/m Live: regexr.com/4pm6n
    1. …in reply to @nhoizey
      Better: /(<p( [^>]*)?>((?!(<\/p>)).|\n)+<\/p>)/m regexr.com/4pm6n