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>