# RegExp - Back Reference?

**URL:** <https://forum.kirupa.com/t/regexp-back-reference/283143>\
**Category:** flash\
**Created:** [March 3, 2009, 2:39am UTC](https://forum.kirupa.com/t/regexp-back-reference/283143 "2009-03-03T02:39:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eslacker](https://avatars.discourse-cdn.com/v4/letter/e/e56c9b/32.png) [@eslacker](https://forum.kirupa.com/u/eslacker)\
**Post date:** [March 3, 2009, 2:39am UTC](https://forum.kirupa.com/t/regexp-back-reference/283143/1 "2009-03-03T02:39:18Z")

</div>

Yo. I’m trying to parse some simple HTML and I have a recurring question that keeps coming up (I’ve been doing multiple RegExp matches but I’m hoping for a better solution).

So, I’m using the following Pattern:  
((\<(b|em)\>).+?((\</(b|em)\>)))

Against the following simple markup:  
\<b\>Dialogue Between Franklin and the Gout \</b\>\<p\>Nuther Paragraph\</p\>\<em\>by Benjamin Franklin \</em\>

Using Reggy, I see that I’m getting each of the matches I want (\<b\>Dialogue…\</b\> and \<em\>by Benjamin…\</em\>, but I want just what’s enclosed in my \<b\>/\<em\> tag. I see Back Reference mentioned, but haven’t been able to wrap my brain around it (and I’m not sure if that’s what I need to use).

Any suggestions? TIA!!! 🙂

Ciao,

-Jei.
