Check out example codes for "extract html tag using regex". It will help you in understanding the concepts better.

Code Example 1

(<span>|<a href="#">|<div onclick="callMe\(\)">)(.*)(</span>|</a>|</div>)

Learn ReactJs, React Native from akashmittal.com