Consider text.txt with this content:  blablabla     &amp;&amp;&amp;key word&amp;&amp;&amp; I want all  these text and numbers 123 and chars !"£$%&amp; as output &amp;&amp;&amp;key word&amp;&amp;&amp; blablabla   I want to implement a regular Expressions with awk which obtain following output:  I want all  these text and numbers 123 and chars !"£$%&amp; as output   I am using this expression:  awk "$1 ~ /^[&amp;&amp;&amp;key word&amp;&amp;&amp;].[&amp;&amp;&amp;key word&amp;&amp;&amp;]/" test.txt   but the result is not what I expect:  &amp;&amp;&amp;key word&amp;&amp;&amp; &amp;&amp;&amp;key word&amp;&amp;&amp;   I apologize because maybe it is not a good question. I already tried many solutions from here and stackoverflow, I read some tutorials but still not able to solve it. If you can also give me a complete tutorial for this topic, I will be very thankful.  Edit: With $0 as advised, I get much better result:  awk "$0 ~ /[&amp;&amp;&amp;key word&amp;&amp;&amp;]/,/[&amp;&amp;&amp;key word&amp;&amp;&amp;]/" test.txt   results in:  &amp;&amp;&amp;key word&amp;&amp;&amp; I want all  these text and numbers 123 and chars !"£$%&amp; as result &amp;&amp;&amp;key word&amp;&amp;&amp;   I still need to remove first and last line, I know if condition like awk "{if (NR!=1&amp;&amp;NR!=-1) {print}}" text.txt but I dont know how can I apply it on the output of above
Is it possible to do a multiline pattern match using sed, awk or grep? Take for example, I would like to get all the lines between { and }  So it should be able to match    1. {}  2. {.....}  3. {.....      .....}  Initially the question used &lt;p&gt; as an example. Edited the question to use { and}.
How do I install Adobe Flash player? Is the universe fundamentally deterministic? I'm not sure if this is the right place to ask this question. I realise that this maybe a borderline philosophical question at this point in time, therefore feel free to close this question if you think that this is a duplicate or inappropriate for this forum. Anyway, I'm an electrical engineer and I have some basic knowledge of quantum mechanics. I know that Schrödinger's equation is deterministic. However, quantum mechanics is much deeper than that and I would like to learn more. If this question is not clearly answerable at this point than can anyone point out some recognized sources that try to answer this question. I would appreciate it if the source is scientific and more specifically, is related to quantum theory. I am reading Velleman's "How to Prove it", and in one example he proves  $\neg \exists x P(x)  \implies \forall x \neg P(x)$    in the following way:    Suppose $\neg \exists x P(x)$. Let x be arbitrary. Suppose $P(x)$. Since we have a specific $x$ for which P(x) is true, it follows that $\exists x P(x)$, which is a contradiction. Therefore $\neg P(x)$. Since $x$ was arbitrary, we can conclude that $\forall x \neg P(x)$, so $\neg \exists x P(x)  \implies \forall x \neg P(x)$    What makes me confused is the line in bold text, that is "Suppose $P(x)$". The reason is that he writes that he is doing proof by contradiction, but $P(x) \not\iff \neg\forall x \neg P(x)$. He is not treating all possible cases where $\forall x \neg P(x)$ is false by assuming $P(x)$, does he? So how can this be a valid proof by contradiction?    Edit: I deleted my first example since it was clearly not representative for the problem.  Edit 2: So the thing that I am opposing I guess is that $\neg \forall x \neg P(x)$ is not $P(x)$. And from what I have undestood, a proof by contradiction should use the negation of the consequent which I do not think that Velleman does. I want to install Ubuntu on the C: partition where my Windows 7 is, simply to replace the systems. I've also tried to install it on another partition (without formating it), which failed!  All I get is:      No root file system is defined. Please correct this from the partitioning menu.   I want to install Ubuntu without formatting any of my partitions. Is that possible? How do I create RAW TCP/IP packets in C++? I'm a beginning C++ programmer / network admin, but I figure I can learn how to do this if someone points me in the right direction. Most of the tutorials are demonstrated using old code that no longer works for some reason.   Since I'm on Linux, all I need is an explanation on how to write raw Berkeley sockets. Can someone give me a quick run down? Redirect www to non-www using Apache htaccess does not work Does the pilot of a rocket ship experience an asymptotic approach to the speed of light? A question has recently come up that goes beyond my knowledge of special relativity.  Suppose a pilot has his foot on the gas pedal of a rocket ship and keeps it applied to achieve a constant acceleration, and he has a magical engine that can maintain the thrust needed to accomplish such acceleration even as the vehicle acquires mass.  He measures his acceleration at periodic intervals and sums it up as he goes.  Observers perceive the rocket to increase in speed and gradually approach the speed of light (but never reach it). Two possibilities are being debated for what the pilot observes, and my preference is for the first:   Time dilation gives him the impression that the summation of his readings are approaching light speed at a constant rate, but there is an asymptote involved here even in the inertial frame such that he never actually perceives himself to reach, let alone exceed, $c$, because time slows down to a crawl (as seen from the reference frame) before this can happen. Although to observers he is only approaching $c$, it is possible for the summation of the measurements on his accelerometer to indicate that he has surpassed $c$ and is now traveling faster than light.  From the reference frame he is approaching $c$ and his instruments in the inertial frame tell him that he has surpassed it.   I assume (1) is true beyond a doubt?  If so, is there a straightforward explanation for this? On proving that a finitely generated group has a finite number of subgroups with index $n$. Theorem: If $G$ is a finitely generated group, then it has a finite (maybe zero) number of subgroups of index $n$ for any $n\in \mathbb{N}$.   is a sketch of a proof. It consists of assuming such a subgroup $H$ exists, and allowing $G$ to act on $G/H$ by left multiplication. Such action defines a homomorphism $$\phi :G \rightarrow \text{Sym}(G/H)\cong \mathbb{S}_n$$  If $G=\langle g_1, \ldots ,g_r\rangle$, then the homomorphism is uniquely determined by where it sends the generators $g_i$. In particular, there are at most $(n!)^r$ such homomorphisms.  The last step of the proof requires one to notice that a different subgroup $H'$ of index $n$ in $G$ would produce a different homomorphism, and here is where I'm struggling. I've been able to show that $\text{ker}(\phi )=\text{core}(H)$, yet haven't been able to rule out the possibility of $\text{core}(H)=\text{core}(H')$. What's the easiest way to set up a LAMP stack? When I try to connect to Google Play, it would say "download Google play service". After I downloaded it, it says that it is "not supported by your device, please contact the manufacturer". How to set tick label precision Prevent back button after logout Birthday line to get ticket in a unique setup At a movie theater, the whimsical manager announces that a free ticket will be given to the first person in line whose birthday is the same as someone in line who has already bought a ticket.  You have the option of choosing any position in the line. Assuming that you don't know anyone else's birthday, and that birthdays are uniformly distributed throughout the year (365 days year), what position in line gives you the best chance of getting free ticket? Calculate the display width of a string in C#? A Java version of this question was just answered, and, well, I don't know how to do this in .net.   So how do you calculate the display width of a string in C# / .net? How to insert an item at the beginning of an array in PHP? Question  The following is from Bartle:  Give an example of a function $f$ on $X$ to $\mathbb{R}$  which is not $X-$measurable but is such that $|f|,$ and $f^2$ are measurable.  Relavant Information  A family $\textbf{X}$ of subsets of $X$ is a $\sigma$ algebra in case:   $\phi, \mathbb{R} \in \textbf{X}$ $X \setminus A \in \textbf{X}$ if $A \in \textbf{X}$ If $(A_n) \in \textbf{X}$, then the union $\bigcup_{n=1}^{\infty} A_n \in \textbf{X}$  Any set in $\textbf{X}$ is called $X-$ measurable.   A function is $X-$ measurable if for every real $\alpha$, the set $\{x \in X : f(x)&gt;\alpha\}$ belongs to $\textbf{X}$  Attempt  Consider the following function: $$f=\begin{cases} 1 &amp;\mbox{ if} \ x \not\in\mathbb{Q} \\                   -1 &amp;\mbox{ if} \ x \in \mathbb{Q}  \end{cases}$$ defined from $\mathbb{R}$ to $\mathbb{R}$ with $\textbf{X}$ being the Borel algebra (the $\sigma$ algebra generated by all open intervals $(a,b)$) Then if $\alpha \in [-1,1)$, the set $\{x: f(x)&gt;\alpha\}$ consists of the irrational numbers. If I can show that the irrationals are not in the Borel Algebra, then I would be done since $|f|=f^2$ is a constant and easily shown to be measurable. Unfortunately I do not know how to show that the irrationals are not in the Borel Algebra.  Edit it has been brought to my attention that the irrationals are in the Borel algebra. I think this is because the rationals, being countable, can be shown to be in the Borel algebra by constructing appropriate small neighborhoods around each rational and then taking the intersections. I now seek to construct a set that is not in the Borel algebra  Alternatively I have tried to define a set other than the irrationals that is not in the Borel Algebra and define a similar function but to no avail. I am currently self studying this book so it would be of great help to me if the answer could contain heuristics on how to tell when a set if borel measurable (although I do not require this in the answer). Is there a way to substring a string in Python, to get a new string from the third character to the end of the string?  Maybe like myString[2:end]?  If leaving the second part means 'till the end', and if you leave the first part, does it start from the start? I sometimes hear stories where people compare their feelings in winter in different places in the world.  It goes like     in city X the temperature was the same as in city Y, but the humidity made me feel much colder...   or      oh well, -20°C would be cold, but the humidity was low, so it felt OK   so it implies that humidity somehow makes it feel colder. I am talking about temperatures below freezing (-30...0°C).  Does this have any physical explanation, or is it some sort of ? What is the difference between a "proof by contradiction" and "proving the contrapositive"? Intuitive, it feels like doing the exact same thing. And when I compare an exercise, one person proves by contradiction, and the other proves the contrapositive, the proofs look almost exactly the same.  For example, say I want to prove: $P \implies Q$ When I want to prove by contradiction, I would say assume this is not true. Assume $Q$ is not true, and $P$ is true. Blabla, but this implies $P$ is not true, which is a contradiction.  When I want to prove the contrapositive, I say. Assume $Q$ is not true. Blabla, this implies $P$ is not true.  The only difference in the proof is that I assume $P$ is true in the beginning, when I want to prove by contradiction. But this feels almost redundant, as in the end I always get that this is not true. The only other way that I could get a contradiction is by proving that $Q$ is true. But this would be the exact same things as a direct proof.   Can somebody enlighten me a little bit here ? For example: Are there proofs that can be proven by contradiction but not proven by proving the contrapositve? This is my first post on this forum :)  I've been trying for a while to solve this problem about symmetric difference of two sets:     Given two sets $A$ and $B$, we call symmetric difference of $A$ and $B$ the following:      $$A\mathrel{\triangle}B = (A\cup B)-(A\cap B)$$      Show that if $A\mathrel{\triangle} B = \emptyset$, then $(A\subset B) \vee (B\subset A)$.   I don’t know where to start; thank you very much for the help :)