Question: How do I match the end of a regular expression by a word? For example:

```
<h1><a href=...></a>CONTENT</h1>

```

Given that `<h1>` is the start tag, how do I return `<a href=...></a>CONTENT`?

The expression `/< h1>(([<\/h1>\b])*/` does not seem to work

Answer: 
```
/<h1>([\s\S]*)<\/h1>/

```

I think this should help you out.
What makes most regular expressions difficult, is the fact that they're greedy by default. By making them *ungreedy* using the [`U` modifier](http://php.net/manual/en/reference.pcre.pattern.modifiers.php), writing something like this becomes very trivial. The following should work.

```
/<h1>(.*)<\/h1>/U

```