I'm tring to get a string between 2 strings with preg\_match

The string is something like this, this is just an example

```
<source src='http://website.com/384238/dsjfjsd.jpg' type='image/jpg' data-res='43543' lang='English'/>

```

I want the link, the "data-res=" is the one that varies so:

I'm doing something like this:

```
preg_match("<source src='(.*)' type='image/jpg' data-res='43543",$input,$output);

```

I also tried this way

```
$output = trim(cut_str($input, '<source src='', ' type='image/jpg' data-res='43543'));

```

I think the problem is not knowing how do I represent the spaces or special chars, I also wanted an advice for whats the best function to solve this