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
Post a Comment