DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Everybody known the
construction to match a tag. But how to match inside a tag ? We want something like:
but it don't work since [^div] has not this meaning ;) This regexp do that (but don't manage nested markups, however).
<div> (?: (?!</div>) # If not followed by </div> . # Match any character )* # Non-capturing grouping </div>