Question: I just wanted to know how unstable is flex4 when compared to flex3?
Which is preferred most flex3 or flex4?

Answer: 
You're better off using something like [simplehtmldom](http://simplehtmldom.sourceforge.net/) to find all links, then find all links with the relevant HTML / href.

Parsing HTML with regex isn't always the best solution, and in your case I feel it will bring you only pain.

```
$href = 'some_href';
$inner_text = 'some text';

$desired_anchors = array();

$html = file_get_html ('your_file_or_url');

// Find all anchors, returns a array of element objects
foreach($html->find('a') as $anchor) {
    if ($a->href = $href && $anchor->innertext == $inner_text) {
        $desired_anchors[] = $anchor;
    }
}

print_r($desired_anchors);

```

That should get you started.
here you go

```
preg_match_all('~<a .*href="(http://link1\..*)".*>(.*)</a>~Ui',$str,$match,PREG_SET_ORDER);
print_r($match);

```