I want to extract all occurrences of a pattern in Python. Here is what i have done  import re  string="Any information &lt;p&gt;sent to the server as clear text&lt;/p&gt;, may be stolen and used later for &lt;p&gt;identity theft&lt;/p&gt; or user impersonation. In addition, several privacy regulations state that sensitive information such as user&lt;p&gt; credentials will always be sent encrypted &lt;/p&gt; to the web site."  regex='&lt;p&gt;.*&lt;/p&gt;' # obviously it matches starting &lt;p&gt; to the last &lt;/p&gt;  if re.findall(regex, String):     print(re.findall(regex, string)) else:     print('no match found')   I want to extract all the occurance of paragraph tags. I mean the output should be a list which looks like this  ['&lt;p&gt;sent to the server as clear text&lt;/p&gt;', '&lt;p&gt;identity theft&lt;/p&gt;', '&lt;p&gt; credentials will always be sent encrypted &lt;/p&gt;']   I've found few similar questions but not serving the purpose
I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?
Could you please correct my batch command?   I had 100 img images which need to be converted into 8 unsigned bit format for further use in TIMESAT.   mkdir test for %%f in (*.img) do gdal_translate -of ENVI -scale -1 1 1 255 -a_nodata 0 -co INTERLEAVE=BSQ "%%f" test/%%f.dat What do we call someone who's in between -a friend and an enemy! He's a friend of mine   The message is clear. He's my friend. He wishes all good for me and helps me whenever I need one.      He's an enemy of mine   The message is clear again. He's my enemy. He wishes all bad for me and never helps me whenever I need!     He's ...... of mine!   The message is clear. He's neither friend nor enemy. He's in between. At times, he may help me but then I cannot always rely on him. He's not a friend of mine.   Other times, he does really bad to me but maybe, there was no any other go for him. He's not an enemy of mine! :) How do you read C declarations? Motivation for spectral graph theory. Proof by induction that if $n \in \mathbb N$ then it can be written as sum of different Fibonacci numbers Proof that every natural number $n\in \mathbb N$, can be written as the sum of different Fibonacci numbers between $F_2,F_3,\ldots,F_k,\ldots$.  For example: $32 = 21 + 8+3 = F_8+F_6+F_4$  Research effort:  The base step it's simple:  Let $k=1$ it can be britten as $k=1=F_2$  For the inductive step I considered:  Let $k = k  F_2 =F_2+F_2+\cdots+F_2 = \sum_{i=2}^w a_iF_i, a_i =\{0,1\} $  Then if $k$ suffice I want to see if $k+1$ suffices too... But I'm not realy seeing how to use the inductive hypothesis, so I assume It's wrong.  Any thoughts on which can the inductive step be? Let $n\geq 2$ and let $k$ be "considerably larger" than $n$ (like some large multiple of $n$). Then for each $i$ such that $0&lt;i&lt;n$ and $\gcd(i,n)=1$ let's define $$c_i=\left|\{p_j\;|\; p_j\equiv i \mod n,\;\mbox{where $p_j$ is the $j$-th prime, $1\leq j\leq k$}\}\right|$$ so $c_i$ represents how many of the first $k$ primes are congruent to $i$ modulo $n$.  What can we say about $c_i$s, that is about the distribution of the first $k$ primes modulo $n$?  I thought the distribution will be seemingly random, and that is mostly true - for example $c_i$s are always very close together. But there are observable non-random patterns. For example for $n=3$, for various $k$s I've tried  (up to $10^6$) I always got $c_2&gt;c_1$. If this were just some kind of random discrepancy due to distribution of small primes, it would eventually vanish for large $k$s, which I don't observe. Does RSA work for any message M? I try to write a simple Markdown parser in JavaScript. Therefore I want to check for the [link content][link id] syntax. I use the following code:  data = data.replace( /\[(.*?)\][ ]*\[([0-9]+)\]/g, '&lt;a href="$2"&gt;$1&lt;/a&gt;' );   It works well, but now I want to do this with a RegExp object. So I set up the following bit of code:  var r = new RegExp( '\[(.*?)\][ ]*\[([0-9]+)\]', 'g' ); data = data.replace( r, '&lt;a href="$2"&gt;$1&lt;/a&gt;' );   But it doesn't work. It even says that my regular expression (which works since the first example does a good job) is invalid:     unmatched ) in regular expression   I think it must have to do with some RegExp-object peculiarities I am not aware of. What am I doing wrong and how can the problem be solved? Java Interface Usage Guidelines -- Are getters and setters in an interface bad? Should questions include "tags" in their titles? I've seen questions edited to remove the language name from the title. Won't search engines - and folks using search engines - have an easier time finding them if these "tags" are kept as part of the title? How to differ sessions in browser-tabs? I'm trying to install wifi drivers for a particular mini wifi card i bought. The output of lsusb is:  0bda:f179 Realtek Semiconductor Corp   I've searched everywhere for drivers, but could not find anything. Any help?  Thanks When transiting Moscow (SVO), citizens of which countries need a transit visa? Logging into Ask LibreOffice with my Stack Exchange OpenID If I'm on , I click on OpenID and then enter  and click Log In, I get a page that says:  An error occurred on the server  This event has been recorded.  If you believe you encountered this message in error, please report it.   I clicked report it and here I am reporting it! Using Firefox 26 Did Dumbledore know that Harry would have to sacrifice himself from the very beginning? Based on the following interchange between Harry and Dumbledore in the pivotal &quot;King's Cross&quot; chapter of Deathly Hallows, I was wondering when exactly Dumbledore put together that Harry would have to die in order to bring about Voldemort's ultimate demise:  &quot;And you knew this? You knew--all along?&quot; &quot;I guessed. But my guesses have usually been good,&quot; said Dumbledore (Deathly Hallows, 599, hardcover).  The conversation that spurred Harry's question includes material dating back to Halloween '81, but also specifically mentions the events of the graveyard from GoF. So, &quot;knowing all along&quot; could refer to everything (i.e., Harry must die, Voldemort ignorantly tethered him to life, etc.) or just that Voldemort tethered him to life. Other important information pertaining to this question can be found in OOTP, when Dumbledore confirms (if he didn't already know) that Harry contains part of Voldemort's soul. He uses the silver instrument to find out that Harry is just like Nagini, having the ability to share mind and soul with Voldemort. He also says the following:  &quot;I guessed, nearly fifteen years ago,&quot; said Dumbledore, &quot;when I saw the scar upon your forehead, what it might mean. I guessed that it might be the sign of a connection forged between you and Voldemort&quot; (Order of the Phoenix, 826-827, hardcover).  While confirming that he guessed that Harry might share a connection with Voldemort from the very beginning, Dumbledore does not confirm with this statement that he knew Harry would ultimately have to give up his life. In Philosopher's Stone, when Dumbledore drops off Harry on the Dursley's doorstep, we know he is not entirely truthful with McGonagall.  McGonagall asks: &quot;How in the name of heaven did Harry survive?&quot; &quot;We can only guess,&quot; said Dumbledore (Philosopher's Stone, 12, hardcover).  Of course, this was a lie. Dumbledore already knew how Harry survived, otherwise he wouldn't be delivering Harry to Lily's sister to extend the blood sacrifice. By proxy, he also knows that Voldemort will return b/c of Horcruxes, otherwise he wouldn't be so worried about Harry. Finally, when asked in the same scene if he could remove the scar, Dumbledore says:  &quot;Even if I could, I wouldn't. Scars can come in handy&quot; (Philosopher's Stone, 15, hardcover).  So, did Dumbledore know at this very moment that Harry would have to die? Did he at least guess it to be true during this scene? We know he gains perfect confirmation in OOTP, but did he know it &quot;all along,&quot; as a particular reading of the King's Cross interchange in DH would have us believe? What is the difference between [0-9]+ and [0-9]++? Removing Ubuntu from UEFI Bios Menu How fast is Earth moving through the universe? As the galaxy is moving and the solar system orbiting the galaxy and the Earth orbiting the sun. So how fast is each object moving and what is the fastest we move at?  Do we even know how fast the galaxy is moving that is not relative to another galaxy (although I guess velocity has to be measured relative to something). Is there an app that will notify me (in notifications center) if a process is using up a high percentage of CPU for a specified amount of time? The other day, I was sitting in a coffee shop working, when I looked down to find that 25% of my battery was left.   I looked at my Activity Monitor and saw that the time machine process was going at 90% for a while (as long as I was watching it).   Are there any apps that can notify me if a process is at a certain level for a certain amount of time? Find out if any files were exported from my MacBook