Make Link Formatter regular expressions more flexible

This is split from patch I9bbbe8055d68b274fa6141eecff4a8d9414f89d9
to make it a bit easier to review.

This makes the regular expressions a lot more flexible. Before they
expected the links in a very specific form without any additional
attributes and as a link to an existing item. The new regex succeeds
for red links with class="new", targets like action=edit&title=Q123
and appended "deleted item" hints.

As far as I can see these two tests aren't supposed to compare the
exact format of the formatters. So being more generic should be ok.

Change-Id: I363360b5bdbe91b07b043adc814012d8f9386b44
Merge "Make Link Formatter regular expressions more flexible"