i have this code written in php  , and i want to convert it into python code 

$title_regex = "/&lt;title&gt;(.+)&lt;\/title&gt;/i";
preg_match_all($title_regex, $string, $title, PREG_PATTERN_ORDER);
$url_title = $title[1];

/// fecth decription
$tags = get_meta_tags($url);

// fetch images
$image_regex = '/&lt;img[^&gt;]*'.'src=[\"|\'](.*)[\"|\']/Ui';
preg_match_all($image_regex, $string, $img, PREG_PATTERN_ORDER);
$images_array = $img[1];


i have tried this .. but it give me errors in pics part 

import re
out=Data #web site html page ..
title_regex = "/&lt;title&gt;(.+)&lt;\/title&gt;/i" #no need for this .. un used 
m = re.search("&lt;title&gt;(.+)&lt;\/title&gt;", out)
print "title",m.group(1)
#for pics i have tried this but it give me error ..
pics = re.match(r"/&lt;img[^&gt;]*'.'src=[\"|\'](.*)[\"|\']/Ui", out)#the conversion is not correct  
print "grop",pics.group(1)


my full code 

import re
import urllib
print "Start"
url="http://www.deviantart.com"
data=urllib.urlopen(url)
out=data.read()
print 
title_regex = "/&lt;title&gt;(.+)&lt;\/title&gt;/i"
m = re.search("&lt;title&gt;(.+)&lt;\/title&gt;", out)
print "first",m
print "title=",m.group(1)

title_regex = "/&lt;title&gt;(.+)&lt;\/title&gt;/i"

pics = re.match(r"/&lt;img[^&gt;]*src=[\"|\'](.*)[\"|\']/Ui", out)

print "pics&gt;&gt;",pics.group(1)


how i can convert a php re>>"/]*'.'src=\"|\'[\"|\']/Ui"  to a python re ?


Question: Usage of "might" and "would" to indicate doubt
Answer: Brian Hooper: I had a look via Google for more information on this point, but, try as I might, I couldn't find anything. I remember reading an article on the difference between "Launching the lifeboat may have saved lives" and "Launching the lifeboat might have saved lives" but I can't remember where so that doesn't help much as a reference.

Nohat: I would say may/might + perfective (have) has a different meaning than the “concession” meaning here. “Launching the lifeboat may have saved lives” implies the lifeboat was launched, whereas “… might have saved lives” implies it wasn’t launched.

==============

I'm not completely sure of how things operate here at Stack Exchange. I'm not trying to step on anyone's toes, nor am I trying to be mean or snide. I don't know if this is the "proper" manner of addressing this. It seems to me that Comments is meant for just that, a short comment. 

This, to my mind, requires much more discussion, [and I hope it doesn't end here. Is there not a venue for advanced discussion?], hence more needed space so I've opted for a  Your Answer. And I believe my comments are directed to answering the question.

With respect, there's no way we can make the assumption that there is a "rule" that will describe for all situations/scenarios that launching or not launching a lifeboat [or similar situation] may or may not or might or might not have saved lives or told or implied to us whether or not a lifeboat was launched.

There are scenarios where both 'may' and 'might' are used with their normal epistemic [level of certainty] meanings to speculate on past time events just as they are used to speculate on future or present condition events.

Let me create a scenario. This is a time before ship to shore radios, radar, etc. were available.

A ferry is about to leave port. A person on the dock remarks, "That boat might sink". That is based on their personal feeling according to whatever facts, feelings, superstitions that person holds that has influenced their choice of 'might'.

A worker who has been involved in maintaining the ferry says, "I warned my superiors. That ferry may sink". 

The owner says, "That ferry will never sink" [Where have we heard that before?]

A foreman says in a suicide note, "I have to address this, ... to set the record straight. We did our best but the owners wanted to save money. That ferry probably will go down on this trip."

Other people, for whatever personal reasons they have, even a premonition, could choose, "The ferry will almost certainly sink" / "The ferry may well/might well sink".

The wide variation, which ranges from zero percent chance [owner] to say, a old time "terrorist" who has made some effort to sink the boat, conjecturing "That ferry will go down", does not mean that anyone of them is right before the boat leaves port.

That's what modals allow us to do, speculate on events, conjecture, and it doesn't matter if the event is past, present or future.

There is a terrible storm, the ferry is overdue. Those same people, probably now joined by countless others, all weigh in with their OPINIONS because, they have nothing else to go on. Remember, this is a time before radios, radar, etc.

1)The ferry went down.

2) The ferry must have sunk.

3) The ferry probably/likely sank.

4) The ferry may have gone down.

5) The ferry might have gone down.

6) The ferry didn't sink.

Again, at this point, with the available information, all are opinions, even 1) and 6), though one of them will, maybe, probably never, eventually be confirmed as fact.

But look at the modal perfect examples for that's the point I'm trying to get across. Sometimes, 'might' just means what it most often normally means, "there's a tiny to small chance that X will occur/is occurring/has occurred".

The ferry, I'm sad to report, [this is my scenario] went down. The people of that time only know this because no trace was ever found of the boat, the people or the things on the boat. No lifeboats were ever launched.

There is now rampant speculation among the population on whether a or some lifeboats would have saved lives.    

1) Lifeboats would have saved lives.

2) Lifeboats almost certainly would have saved lives.

[Note that 'must have saved lives', epistemically equal to 'almost certainly would have saved lives' isn't possible here]

3) Lifeboats probably/likely would have saved lives.

[Note that 'should have saved lives', is strange here even though 'should' is epistemically equal to 'probably/likely'.]

4) Lifeboats may have saved lives.

5) Lifeboats might have saved lives.

6) Lifeboats wouldn't have saved lives.

But all these are still simply personal opinions, not statements of fact.

Look at the 'may have' and 'might have' parts. There's no implication in the 'might have saved lives' opinion that lifeboats were launched. There's a fact that dismisses any such implication. No lifeboats were launched.

Certainly, there are situations where 'might' and 'may are used to effect a meaning other that their basic epistemic/level of certainty meanings. I noted this with respect to 'might' in my previous post.

We know that there are meanings for 'may' and for 'might' that are sometimes used to make a concession and sometimes, to angrily suggest [sometimes using understatement] that something should have been done. 

For this scenario, "You might have [at the very least] sent out one search boat!" 

What nohat stated was true, but it's not true for all situations, not even for most; I'd say that its true for a small portion of 'might have + PP' situations. 

I'm sorry that this is so long, but if you'll bear with me. I've read often this idea presented by nohat. It is similar in nature to the thought used to prohibit "If S was" as a counterfactual use. 

Somebody, sometime, noticed that "If S was" can hold the meaning of "allowing that that is true, ... ", so they errantly made a determination that that excluded the counterfactual 'was' use in "If I was you, ... ". 

Language is exceedingly complex and these kinds of expansive notions aren't helpful to come to an understanding of language. They have no affect on native speakers, save for the fact that the myths continue to be spread, but they have a gigantic affect on ESL/EFLs, both in terms of comprehension and production.

Another of these expansive notions is the idea that 'would' is subjunctive. It is not! There are only a few examples of the subjunctive left in English and 'would' is not one of them.

'would' can be, and is often used in subjunctive uses to express subjunctive/contrary to fact ideas, but so are a lot of other modals.

'would' also hold the meaning of 100% true, "that would be Bill"; "He would, ten years later, be elected president". 

The original question, which I'm now pointedly getting to, [how does one illustrate a degree of embarrassment?]

My parents would have walked along the Barrow

likely, in my opinion, shows this same meaning of 'would', ie. 100% true. I may be wrong for this particular instance but that doesn't negate the fact that that is how 'would' is often used. 


  Cindi noted: I think the intention is
  to evoke the event rather than just
  record it.


Cindi and I disagree. She has an opinion on how 'would' is being used here that differs from my opinion. She may well be right. The speaker could be using 'would have' in the same sense as 'must have', which would express some degree of doubt.

The mistaken notion that 'would' is always subjunctive/shows doubt cause these kinds of misunderstanding. I suspect that the person who asked the original question is a native speaker - I could be wrong here too but nevertheless, the answers, I feel, illustrate just how strong this notion is set even in the conscious ideas of native speakers. 

It's interesting to note, please do, that this notion doesn't exist in our personal natural grammars because we all use this idea of 'would' as 100% true in so many instances, without it twigging whatever conscious prescriptions we hold.