javascript - regex capturing all content instead of just untill first defined string -



javascript - regex capturing all content instead of just untill first defined string -

i converting content of tutorials , extracting html tags. made regex: /<html\>(?!html)([\s\s]*)<\/html\>/ trying create capture content of first html group, captures untill lastly html, despite (maybe bad placed) negative lookahead.

what did miss here? (live example)

this text <html> <div> content </div> </html> more text <html> <div> content </div> </html>

make regex lazy:

<html\>([\s\s]*?)<\/html\>

that should take until first html tag.

javascript html regex

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -